From da350a52fd42f33fbdf0b853a9ccb756c8c57f45 Mon Sep 17 00:00:00 2001 From: andrew rumble Date: Tue, 13 Aug 2024 09:42:38 +0100 Subject: [PATCH] Check that we are using same ObjectId as mongoose GitOrigin-RevId: 95812e15365bea740dfd02215e706f8014239840 --- services/web/app/src/infrastructure/mongodb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/src/infrastructure/mongodb.js b/services/web/app/src/infrastructure/mongodb.js index 4cb1292ca2..f65e51c896 100644 --- a/services/web/app/src/infrastructure/mongodb.js +++ b/services/web/app/src/infrastructure/mongodb.js @@ -8,7 +8,7 @@ const { addConnectionDrainer } = require('./GracefulShutdown') // otherwise we will get multiple versions of the ObjectId class. Mongoose // patches ObjectId, so loading multiple versions of the mongodb module can // cause problems with ObjectId comparisons. -if (Mongoose.mongo !== mongodb) { +if (Mongoose.mongo.ObjectId !== mongodb.ObjectId) { throw new OError( 'FATAL ERROR: Mongoose is using a different mongodb instance' )