mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #16186 from overleaf/mj-mongo-object-id
[web] Use constructor for ObjectId GitOrigin-RevId: 9eb8b377ea599605b72af237d1ab12f4d8287162
This commit is contained in:
committed by
Copybot
parent
0ac514f81b
commit
c371732e6e
@@ -53,7 +53,7 @@ async function main() {
|
||||
|
||||
async function processDoc(docId) {
|
||||
// check if the doc is in mongo.. if so ignore it
|
||||
const docCount = await db.docs.find({ _id: ObjectId(docId) }).count()
|
||||
const docCount = await db.docs.find({ _id: new ObjectId(docId) }).count()
|
||||
if (docCount > 0) {
|
||||
logger.debug({ docId }, 'doc is present in mongo - no recovery needed')
|
||||
return
|
||||
@@ -70,7 +70,7 @@ async function processDoc(docId) {
|
||||
return
|
||||
}
|
||||
// check that the project is in mongo, if not delete the doc
|
||||
const project = await db.projects.findOne({ _id: ObjectId(projectId) })
|
||||
const project = await db.projects.findOne({ _id: new ObjectId(projectId) })
|
||||
if (!project) {
|
||||
logger.warn(
|
||||
{ docId },
|
||||
|
||||
Reference in New Issue
Block a user