Selaa lähdekoodia

Merge pull request #9864 from overleaf/msm-fix-audit-log

[scripts] fix audit log migration script

GitOrigin-RevId: a7e32217385ac66a899e34eb3e0e8373bc802944
Miguel Serrano 4 vuotta sitten
vanhempi
sitoutus
b1937700cc
1 muutettua tiedostoa jossa 6 lisäystä ja 4 poistoa
  1. 6 4
      services/web/scripts/migrate_audit_logs.js

+ 6 - 4
services/web/scripts/migrate_audit_logs.js

@@ -89,10 +89,12 @@ async function processUsersBatch(users, options) {
   }
 
   await promiseMapWithLimit(options.writeConcurrency, users, async user => {
-    const projects = await db.projects.find(
-      { owner_ref: user._id, auditLog: { $exists: true } },
-      { _id: 1, auditLog: 1 }
-    )
+    const projects = await db.projects
+      .find(
+        { owner_ref: user._id, auditLog: { $exists: true } },
+        { _id: 1, auditLog: 1 }
+      )
+      .toArray()
     await processProjectsBatch(projects, options)
   })
 }