test.py 480 B

1234567891011121314151617181920
  1. import xml.etree.ElementTree as ET
  2. from subdir import service
  3. from bson.objectid import ObjectId
  4. from pymongo import MongoClient
  5. import asyncio
  6. client = MongoClient()
  7. db = client["baojia"]
  8. collection = db["qdxm"]
  9. for post in collection.find():
  10. if "__children" in post:
  11. child = post["__children"]
  12. for entry in child:
  13. if '附注' in entry['清单编码'] and '换' in entry['清单编码']:
  14. print(entry['清单编码'])