过滤结果

  1. import pymongo
  2.  
  3. myclient = pymongo.MongoClient("mongodb://localhost:27017/")
  4. mydb = myclient["mydatabase"]
  5. mycol = mydb["customers"]
  6.  
  7. myquery = { "address": "Park Lane 38" }
  8.  
  9. mydoc = mycol.find(myquery)
  10.  
  11. for x in mydoc:
  12. print(x)