pymongo

from pymongo import MongoClient
# 连接数据库
client = MongoClient("mongodb://"
                                          + self.username
                                          + ":"
                                          + self.password
                                          + "@"
                                          + self.host
                                          + ":"
                                          + self.port)

# 连接集合
collection = client.xinyongfei_rcs.bairongLog

# 单条查询
collection.find({"id_card_number":"1525257155", "mobile":52525})

 

posted @ 2019-07-05 17:41  yile  阅读(126)  评论(0编辑  收藏  举报