mongojs icon indicating copy to clipboard operation
mongojs copied to clipboard

ObjectId.id issue after upgrading version to 2.x.x

Open rohittailor opened this issue 6 years ago • 0 comments

Hi,

To support SSL (X509 certificate based) mongoDB connection, I have upgraded mongojs version from 0.14.1 to 2.4.0 but its throwing following error:

[Error] Error: invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [{"base64":true,"data":"VsWHAZWlq7w7zDEn"}] at ObjectID.toHexString (/apps/node_app/hendrix_notification/node_modules/mongojs/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/objectid.js:93:11) at ObjectID.toJSON (/apps/node_app/hendrix_notification/node_modules/mongojs/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/objectid.js:208:15) at Object.stringify (native) at Object.module.exports.stringify

In OLD version, SSL is not supported and in new version facing issue.

Please help to resolve this.

rohittailor avatar May 24 '18 12:05 rohittailor