mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Updated mongoose
This commit is contained in:
17
node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js
generated
vendored
17
node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js
generated
vendored
@ -5,25 +5,10 @@
|
||||
* @see ObjectId
|
||||
*/
|
||||
|
||||
var ObjectId = require('mongodb').BSONPure.ObjectID;
|
||||
var ObjectId = require('mongodb').ObjectId;
|
||||
|
||||
/*!
|
||||
* ignore
|
||||
*/
|
||||
|
||||
var ObjectIdToString = ObjectId.toString.bind(ObjectId);
|
||||
module.exports = exports = ObjectId;
|
||||
|
||||
ObjectId.fromString = function(str){
|
||||
// patch native driver bug in V0.9.6.4
|
||||
if (!('string' === typeof str && 24 === str.length)) {
|
||||
throw new Error("Invalid ObjectId");
|
||||
}
|
||||
|
||||
return ObjectId.createFromHexString(str);
|
||||
};
|
||||
|
||||
ObjectId.toString = function(oid){
|
||||
if (!arguments.length) return ObjectIdToString();
|
||||
return oid.toHexString();
|
||||
};
|
||||
|
Reference in New Issue
Block a user