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})