node.js - NodeJs Convert string to BSON object -


how can convert string (_id) bson object?

as driver i'm using monk.

monk defines id , oid (alias) methods casting objectid:

users.id() // returns new generated objectid users.id('hexstring') // returns objectid users.id(obj) // returns objectid 

though seems capable of working string well:

users.findbyid('hex representation', function(err, doc){}); users.findbyid(oid, function(err, doc){}); 

Comments

Popular posts from this blog

PHP Error "Undefined index" -

C# List<> to xml -

php - How to only save new tweets/instagram photos to database? -