mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #21668 from overleaf/jpa-mongo-utils
[mongo-utils] create new home for batchedUpdate helper GitOrigin-RevId: 9f61c5e367a9f4cef63b5cc4c0bbbd3ef57c8ca8
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import mongodb from 'mongodb-legacy'
|
||||
import { promiseMapWithLimit } from '@overleaf/promise-utils'
|
||||
import BatchedUpdateModule from './helpers/batchedUpdate.mjs'
|
||||
import { batchedUpdate } from '@overleaf/mongo-utils/batchedUpdate.js'
|
||||
import ChatApiHandler from '../app/src/Features/Chat/ChatApiHandler.js'
|
||||
import DeleteOrphanedDataHelper from './delete_orphaned_data_helper.mjs'
|
||||
import { ensureMongoTimeout } from './helpers/env_variable_helper.mjs'
|
||||
import { db } from '../app/src/infrastructure/mongodb.js'
|
||||
|
||||
const { batchedUpdate } = BatchedUpdateModule
|
||||
const { ObjectId } = mongodb
|
||||
const { getHardDeletedProjectIds } = DeleteOrphanedDataHelper
|
||||
|
||||
@@ -86,7 +86,7 @@ async function main() {
|
||||
_id: 1,
|
||||
project_id: 1,
|
||||
}
|
||||
await batchedUpdate('rooms', {}, processBatch, projection)
|
||||
await batchedUpdate(db.rooms, {}, processBatch, projection)
|
||||
console.log('Final')
|
||||
console.log(RESULT)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user