Procházet zdrojové kódy

Check that we are using same ObjectId as mongoose

GitOrigin-RevId: 95812e15365bea740dfd02215e706f8014239840
andrew rumble před 2 roky
rodič
revize
da350a52fd
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      services/web/app/src/infrastructure/mongodb.js

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