Using maxTimeMS parameter with aggregation queries on Mongo 2.6 and Pymongo 2.7.1
问题 I'm unable to use maxTimeMS parameter with Mongo 2.6 and Pymongo 2.7.1 As per the documentation on this page Official Mongodb Aggregation Page the aggregation method should return a Cursor object. However, when I run the query locally on a mongod instance (2.6+) with pymongo 2.7.1, I get a dict object! In [14]: obj = coll.aggregate({'$group': {'_id': '$l', 'n': {'$sum': 1}}}) In [15]: type(obj) Out[15]: dict Can anyone help me understand what is happening here? 回答1: Yes, you can use maxTimeMS