Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymongo
- client = pymongo.MongoClient('0.0.0.0', 27017)
- db = client.documents
- collection = db.collections
- test_data = collection.find_one({'metadata.encodingStage.terms.data.line.data.account.shortDescription': {'$exists': True}},
- {'metadata.encodingStage.terms.data.line.data.account.shortDescription': 1})
- {'_id': ObjectId('5a2fb9371de46756df51f37b'),
- 'metadata': {'encodingStage': {'terms': {'data':
- {'line': [{'data': {'account': {'shortDescription': ['123456']}}},
- {'data': {'account': {'shortDescription': ['7890123']}}}]}}}}}
- _id shortDescription
- -------------------------------------------------------
- ObjectId('5a2fb9371de46756df51f37b') 123456
- ObjectId('5a2fb9371de46756df51f37b') 7890123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement