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 - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -