diff --git a/lib/types/objectid.js b/lib/types/objectid.js index cbe9bd8b06a..692799e0994 100644 --- a/lib/types/objectid.js +++ b/lib/types/objectid.js @@ -24,4 +24,8 @@ Object.defineProperty(ObjectId.prototype, '_id', { } }); +ObjectId.prototype.valueOf = function() { + return this.toString(); +}; + module.exports = ObjectId;