Skip to content

Instantly share code, notes, and snippets.

@tzechienchu
Created July 14, 2016 09:11
Show Gist options
  • Save tzechienchu/50c2065c0d5b9da6b9ab425d2cdc44c7 to your computer and use it in GitHub Desktop.
Save tzechienchu/50c2065c0d5b9da6b9ab425d2cdc44c7 to your computer and use it in GitHub Desktop.
var ObjectID = require("bson-objectid");
webappfiles.genMongoId = function(objectId,cb) {
console.log(ObjectID(objectId)); //Correct One
console.log(MongoId(objectId)); //Wrong
cb(null,ObjectID(objectId))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment