Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pymongo import MongoClient
- import os,pymongo
- dbuser = os.environ.get('muser', '')
- dbpass = os.environ.get('mpwd', '')
- uri = 'mongodb://{dbuser}:{dbpass}@machine.company.com:27017/wifiautomation'.format(**locals())
- client = MongoClient(uri)
- db = client.wifiautomation
- collection = db['test_audit']
- cursor = collection.find({})
- for document in cursor:
- if document['version'] == '9.130.39.0.32.6.1':
- #print document['projects']
- for project in document['projects']:
- print project['name']
- #print project['submission']
- print project['submission']['status']
- if project['submission']['status'] !=queued:
- project['submission']['status'] = 'queued'
- #Update the field
Add Comment
Please, Sign In to add comment