You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to pymongo you can pass a kwarg parameter useCursor in an aggregate call so the returned value will be a cursor instead of a document with the whole query result. This seems to be not working with txmongo, I'm getting a aggregate() got an unexpected keyword argument 'useCursor' error.
I also checked the aggregate method in collection.py but couldn't find anything related to a cursor, only **kwargs (just like in pymongo), but they seem to be not working.
Am I missing something here maybe?, Thank you so much for your help.
The text was updated successfully, but these errors were encountered:
@miketb24 A lot of the deep internals in txmongo (especially things that deal with IO, like cursors) are not directly compatible with pymongo. It is very difficult (if not impossible) to directly iterate over something in Twisted that depends on IO in the middle of a loop.
Perhaps the documentation should be more clear to point those differences out.
Quick research on the topic showed that aggregate command with cursor:{} returns a document of different shape: it contains the cursor id (possibly 0) and the first batch of results.
The solution would be to extract cursor consuming logic from find_with_cursor and use it in both find_with_cursor and aggregate.
According to pymongo you can pass a kwarg parameter
useCursor
in an aggregate call so the returned value will be a cursor instead of a document with the whole query result. This seems to be not working with txmongo, I'm getting aaggregate() got an unexpected keyword argument 'useCursor'
error.This is a sample of the code I'm running:
I also checked the aggregate method in collection.py but couldn't find anything related to a cursor, only **kwargs (just like in pymongo), but they seem to be not working.
Am I missing something here maybe?, Thank you so much for your help.
The text was updated successfully, but these errors were encountered: