(MongoDB 2.6) Can't use maxTimeMS with aggreagtion in Pymongo 2.7.1

Yametazamwa mara 140
Ruka hadi kwenye ujumbe wa kwanza ambao haujasomwa

Abhishek Vaid

hayajasomwa,
11 Jul 2014, 01:42:3111/07/2014
kwa mongod...@googlegroups.com
I want to use maxTimeMS with aggregation query in Pymongo 2.7.1. The underlying mongod is 2.6+ and it supports maxTimeMS.

I tried inspecting the return object from aggregation command in pymongo and it returns a 'dict' object as opposed to a Cursor object.

Is it even possible to use maxTimeMS with aggregation in pymongo 2.7.1?

Urgent help needed!

Bernie Hackett

hayajasomwa,
11 Jul 2014, 10:53:4711/07/2014
kwa mongod...@googlegroups.com
>>> c.foo.bar.aggregate([], maxTimeMS=1000)
{u'ok': 1.0, u'result': []}

If you want a cursor:

>>> for result in c.foo.bar.aggregate([], cursor={}, maxTimeMS=1000):
...     print result

The aggregate command didn't support cursors before MongoDB 2.6 so we had to make it an option to avoid breaking existing applications.


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/dbc3394b-8c5d-444b-9945-a7291022d869%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jibu wote
Mjibu mchapishaji
Sambaza
Ujumbe 0 mpya