You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from bson.objectid import ObjectId
x = collection.find()
i = list(x)[0]['_id']
y = collection.find({'_id': ObjectId(i)})
print(list(y))
I see that database in mdb format has "_id": {"$oid": "id"} and I tried to find id in string with: {"_id.$oid": "string id"} but anyway, it would not work. Any suggestions? Thanks!
The text was updated successfully, but these errors were encountered:
Could not find by ObjectId. Code:
I see that database in mdb format has
"_id": {"$oid": "id"}
and I tried to find id in string with:{"_id.$oid": "string id"}
but anyway, it would not work. Any suggestions? Thanks!The text was updated successfully, but these errors were encountered: