Python操作MongoDB查询时处理ObjectId
时间:2021-07-01 10:21:17
帮助过:3人阅读
bson
import ObjectId
import pymongo
conn = pymongo.MongoClient(
‘mongodb://root:abc123@127.0.0.1/admin‘
str =
"5sdfadsfasdfxzcasdfasdfas"
findinfo = conn.db_name.table_name.find({
"_id" : ObjectId(str)})
Python操作MongoDB查询时处理ObjectId
标签:cas inf roo 字符串 from color 查询 info client