From 497047d1c666ef1d198ea5a3cc69dc820ae52a55 Mon Sep 17 00:00:00 2001 From: andrew rumble Date: Fri, 16 Aug 2024 10:53:10 +0100 Subject: [PATCH] Update mongoose count usages to countDocuments count was removed see: https://mongoosejs.com/docs/migrating_to_8.html#removed-count. GitOrigin-RevId: 308c8f4b681269c29669c45b5f2022404b3af463 --- services/web/app/src/Features/Tags/TagsHandler.js | 2 +- .../analytics/sync_group_subscription_memberships.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/Features/Tags/TagsHandler.js b/services/web/app/src/Features/Tags/TagsHandler.js index fb9248e369..65314c8d74 100644 --- a/services/web/app/src/Features/Tags/TagsHandler.js +++ b/services/web/app/src/Features/Tags/TagsHandler.js @@ -8,7 +8,7 @@ async function getAllTags(userId) { } async function countTagsForProject(userId, projectId) { - return Tag.count({ user_id: userId, project_ids: projectId }) + return Tag.countDocuments({ user_id: userId, project_ids: projectId }) } async function getTagsForProject(userId, projectId) { diff --git a/services/web/scripts/analytics/sync_group_subscription_memberships.js b/services/web/scripts/analytics/sync_group_subscription_memberships.js index 69ce0f1d25..dd3f848528 100644 --- a/services/web/scripts/analytics/sync_group_subscription_memberships.js +++ b/services/web/scripts/analytics/sync_group_subscription_memberships.js @@ -16,8 +16,10 @@ async function main() { console.log('## Syncing group subscription memberships...') - const subscriptionsCount = await Subscription.count({ groupPlan: true }) - const deletedSubscriptionsCount = await DeletedSubscription.count({ + const subscriptionsCount = await Subscription.countDocuments({ + groupPlan: true, + }) + const deletedSubscriptionsCount = await DeletedSubscription.countDocuments({ 'subscription.groupPlan': true, })