test.py 436 B

12345678910111213141516171819202122
  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["dinge"]
  8. collection = db["de-collection"]
  9. for post in collection.find():
  10. h = post['DEBH']
  11. hit = 0
  12. for i in range(len(h)):
  13. if h[i] == '-':
  14. hit = hit + 1
  15. if hit == 2:
  16. print(h)
  17. print(post['parent'])