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