Эх сурвалжийг харах

Update mongoose count usages to countDocuments

count was removed see:
https://mongoosejs.com/docs/migrating_to_8.html#removed-count.

GitOrigin-RevId: 308c8f4b681269c29669c45b5f2022404b3af463
andrew rumble 2 жил өмнө
parent
commit
0c428e149f

+ 1 - 1
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) {

+ 4 - 2
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,
   })