I need to get documents from db using oid, for example:
Docs.objects(_id='4f4381f4e779897a2c000009')
But how to do this, if _id requires an ObjectId object, and even I try to set the ObjectId from pymongo, it does not work.
Docs.objects(_id=pymongo.objectid.ObjectId('4f4381f4e779897a2c000009'))
return empty list
source
share