I'm new to MongoDB, and I'm having trouble getting my point notation requests to work ...
I am using pymongo with MongoDB running on a remote instance of Amazon EC2 ...
Instead of writing massive XML parsing code to extract a lot of different data, I convert XML to JSON, dumping everything into MongoDB, and then trying to extract pieces of data that I want to use with point queries ...
Data is converted to JSON and pasted into Mongo fine. I see all the inserts (from the python shell) ...
for an element in db.feed.find (): element
Here is an example that returns ...
{u'timestamp': datetime.datetime(2010, 11, 8, 20, 19, 55, 87000), u'message': u'{"category": {"text": "Scores"}, "XML_File_ID": {"text": "12292403"}, "game": {"status": {"text": "4 Qtr", "attrib": {"numeral": "4", "type": "P"}}, "time_r": {"text": "10:01"}, "vscore": {"text": "27"}, "vteam": {"text": "Pittsburgh", "attrib": {"id": "082"}}, "hteam": {"text": "Cincinnati", "attrib": {"id": "064"}}, "hscore": {"text": "14"}}, "seasontype": {"text": "Regular"}, "schedule_id": {"text": "3151"}, "location": {"city": {"text": "Pittsburgh"}, "state": {"text": "PA"}, "country": {"text": "USA"}}, "time_stamp": {"text": " November 8, 2010, at 11:19 PM ET "}, "game_id": {"text": "3151"}, "sport": {"text": "NFL"}, "heading": {"text": "BC-ABP+082:064* 27 14 4R10:01"}}', u'_id': ObjectId('4cd8cbebe8b5d58527000016')}
So, I am trying to make such a request, but I am not getting any results ...
db.feed.find_one ({"message.category.text": "Scores"})
What is the correct way to execute queries of this type and return the entire document in response? Thank!