I am trying to retrieve my data from MongoDB
using Python
but u
get added to its key value.
Here is my program:
from pymongo import MongoClient
import json
import array
Data = MongoClient()
Variable = Data.Abhi
Dataset = []
i = 0
Outcome = Variable.Temp.find()
for Result in Outcome:
Dataset.append(Result)
print Dataset
Output :
[{u'cuisine': u'Italian', u'borough': u'Manhattan', u'name': u'Vella', u'restaurant_id': u'41704620', u'grades': [{u'grade': u'A', u'score': 11}, {u'grade': u'B', u'score': 17}], u'address': {u'building': u'1480', u'street': u'2 Avenue', u'zipcode': u'10075', u'coord': [-73.9557413, 40.7720266]}, u'_id': ObjectId('576948b163a37b378dc21565')}]
I have checked using terminal with find() in my database it is showing
{ "_id" : ObjectId("576948b163a37b378dc21565"), "cuisine" : "Italian", "name" : "Vella", "restaurant_id" : "41704620", "grades" : [ { "grade" : "A", "score" : 11 }, { "grade" : "B", "score" : 17 } ], "address" : { "building" : "1480", "street" : "2 Avenue", "zipcode" : "10075", "coord" : [ -73.9557413, 40.7720266 ] }, "borough" : "Manhattan" }
Please help me where am I making mistake.
Thanks in advance.