Pymongo find if value has a datatype of NumberLong
问题 I'm using the Pymongo driver and my documents look like this: { "_id" : ObjectId("5368a4d583bcaff3629bf412"), "book_id" : NumberLong(23302213), "serial_number" : '1122', } This works because the serial number is a string: find_one({"serial_number": "1122"}) However, this doesn't: find_one({"book_id": "23302213"}) Obviously its because the book_id has a datatype of NumberLong. How can execute the find method based on this datatype? ================================================== Update: