On Tue, 17 May 2016 08:43:14 +0200, Sönke Ludwig wrote:

Am 06.05.2016 um 10:07 schrieb can:

How do I distinct on MongoDB query?

I'd have to try it to be sure, but I'd suspect this to work:

coll.find(["query": query, "distinct": Bson(fieldname)])

If it does, I'd add a method to MongoCursor, so that this would also
work then:

col.find(query).distinct(fieldname)

There is now MongoCollection.distinct() on GIT master: c0166ee