[SERVER-10165] Change aggregate shell helper to return cursor. Created: 10/Jul/13  Updated: 22/Nov/13  Resolved: 08/Oct/13

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Shell
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DOCS-1928 Document : Change aggregate shell hel... Closed
Related
related to DOCS-2061 db.collection.aggregateCursor() helpe... Closed
Backwards Compatibility: Major Change
Participants:

 Description   

If connected to a server that doesn't support agg cursors, fallback to non-cursor form and return a simulated cursor.

Most of the work here will involve updating the tests to work with the new API.



 Comments   
Comment by auto [ 08/Oct/13 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-10165 aggregate() shell helper now returns a cursor

The actual change is in src/mongo/shell/collection.js with the remaining changes
to adjust tests to the new api.

The "ideal" arguments are now an array of pipeline ops and an optional object
with extra top-level options for the command (such as

{explain: true}

. For
backwards compatibility, we still support the varargs style where each argument
is a pipeline stage, but there is no way to specify extra parameters in this
mode.
Branch: master
https://github.com/mongodb/mongo/commit/061a086641a2638d73884ad573eaea2a3ab8459f

Comment by Daniel Pasette (Inactive) [ 17/Sep/13 ]

I think we should make a hard break of backwards compatibility here. 2.6+ will always return a cursor. If you want to use a 2.6+ shell without a cursor, the workaround is to not use the helper in the shell and not pass the cursor.

Currently for the jstests that use the aggregate helper, it calls the cursor and non-cursor forms and asserts that the return values are the same. For cursor specific tests, we use the explicit command form and pass the "cursor" param.

Comment by auto [ 11/Jul/13 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-5932 Aggregation returning a cursor

related tickets:
SERVER-8261 System for commands to return cursors
SERVER-10165 aggregate() helper should return cursor
Branch: master
https://github.com/mongodb/mongo/commit/a51f2688fa05672d999c997170847a3ee29a223b

Generated at Thu Feb 08 03:22:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.