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})
相關文章
相關標籤/搜索