Thanks for all the kind words about Motor. But if you're already using AsyncMongo and you just need to do a distinct query, you don't need to switch to Motor.
The problem is, "distinct" not an option for a query, it is a separate command:
http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-DistinctSo use AsyncMongo's command() method:
>>> from tornado.ioloop import IOLoop
>>> import asyncmongo
>>> db = asyncmongo.Client(pool_id='mydb', host='127.0.0.1', port=27017, maxcached=10, maxconnections=50, dbname='test')
>>> def callback(result, error):
... print result
... IOLoop.instance().stop()
...
>>> db.command('distinct', 'my_data', key='my_key', callback=callback)
>>> IOLoop.instance().start()
{u'stats': {u'cursor': u'BasicCursor', u'timems': 0, u'nscannedObjects': 5, u'nscanned': 5, u'n': 5}, u'values': [1.0, 2.0], u'ok': 1.0}
The data you need is in result['values'].
More examples of using commands from AsyncMongo are in its test suite:
https://github.com/bitly/asyncmongo/blob/master/test/test_command.pyAnd information on MongoDB commands in general (the examples are in PHP but it's easy to understand even for Python coders like us):
http://www.kchodorow.com/blog/2011/01/25/why-command-helpers-suck/