node.js - How do I remove the need to convert _id (as a string) to new ObjectID(string) in nodejs / mongodb native library? -


each time have perform query involving _id, have new objectid( _idasstring) in order work. realize mongo tests object, not value itself, adding lot of overhead , may miss converting in places.

the _id goes client objectid( string ) turned string , when comes client, have remake objectid( string ). mention "string" actual value generated mongo, 123a1b12dc...

if there good/complete library such internal functionality, love try out.

there node.js object mappers provide functionality. take @ mongolia.

https://github.com/masylum/mongolia#mappings-and-type-casting


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -