Guest User

Untitled

a guest
Mar 22nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. from pymongo import MongoClient
  2. import os,pymongo
  3. dbuser = os.environ.get('muser', '')
  4. dbpass = os.environ.get('mpwd', '')
  5. uri = 'mongodb://{dbuser}:{dbpass}@machine.company.com:27017/wifiautomation'.format(**locals())
  6. client = MongoClient(uri)
  7. db = client.wifiautomation
  8. collection = db['test_audit']
  9. cursor = collection.find({})
  10. for document in cursor:
  11. if document['version'] == '9.130.39.0.32.6.1':
  12. #print document['projects']
  13. for project in document['projects']:
  14. print project['name']
  15. #print project['submission']
  16. print project['submission']['status']
  17. if project['submission']['status'] !=queued:
  18. project['submission']['status'] = 'queued'
  19. #Update the field
Add Comment
Please, Sign In to add comment