I have MongoDB documents that looks like this (unimportant data removed for clarity):
{
"posts": [
{
"id": 1234,
"comments": "I want this data!"
},
{
"id": 4444,
"comments" "foo"
}
]
}
With only the knowledge that it's in the object with id=1234, how can I use Pymongo (Python 3) to return the "comments" value, ie "I want this data!"?
Thanks