Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import pymongo
  2.  
  3. client = pymongo.MongoClient('0.0.0.0', 27017)
  4. db = client.documents
  5. collection = db.collections
  6. test_data = collection.find_one({'metadata.encodingStage.terms.data.line.data.account.shortDescription': {'$exists': True}},
  7. {'metadata.encodingStage.terms.data.line.data.account.shortDescription': 1})
  8.  
  9. {'_id': ObjectId('5a2fb9371de46756df51f37b'),
  10. 'metadata': {'encodingStage': {'terms': {'data':
  11. {'line': [{'data': {'account': {'shortDescription': ['123456']}}},
  12. {'data': {'account': {'shortDescription': ['7890123']}}}]}}}}}
  13.  
  14. _id shortDescription
  15. -------------------------------------------------------
  16. ObjectId('5a2fb9371de46756df51f37b') 123456
  17. ObjectId('5a2fb9371de46756df51f37b') 7890123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement