I imported a json file into my database, and the db itself works.
If use
print db.points.find_one()
my output looks like :
{u'id': u'342902', u'_id': ObjectId('555af76a029d3b1b0ff9a4be'), u'type': u'node', u'pos': [48.9979746, 8.3719741], u'created': {u'changeset': u'7105928', u'version': u'4', u'uid': u'163673', u'timestamp': u'2011-01-27T18:05:54Z', u'user': u'Free_Jan'}}
which is exactly what I want it to be. But if I want to get the number of distinct users:
print db.points.distinct({"created.user"}).length
I get the error:
TypeError: key must be an instance of basestring
which suggests that what I was searching for is not there (it clearly is as shown above). What am I missing here ?