How do I find the document with the maximum uid field with map-reduce in pymongo?
uid
I have tried the following but it prints out blanks:
f
You can use find_one to find the doc with the maximum uid by sorting on that field descending:
db.things.find_one(sort=[("uid", -1)])
or using the defined constant:
db.things.find_one(sort=[("uid", pymongo.DESCENDING)])