Python: How do I provide my own ObjectID / _id when I insert into a MongoDB? -


i'm inserting information regarding files mongodb, among other things checksum file. want use checksum _id document. how do that?

you set _id field explicitly on document storing. example:

document = {} document['_id'] = my_id 

please note _id value has unique every document. store checksum _id if know unique.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -