[SERVER-25551] Aggregation batchSize can't be set on subsequent getMore in the shell Created: 11/Aug/16  Updated: 14/Feb/18  Resolved: 12/Sep/16

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 3.3.14

Type: Improvement Priority: Major - P3
Reporter: Andrew Ryder (Inactive) Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to PHPC-1109 Support batchSize getMore option for ... Closed
is related to SERVER-21797 Simplify find batching logic Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2016-08-26, Platforms 2016-09-19
Participants:

 Description   

The wire protocol permits batchSize to be set for getMore's but there is no way to access this on a cursor returned by the 'aggregate' helper.

The net result is that batchSize can be set only for the initial batch in aggregation, after that it is whatever fits in the 4MB getMore payload (or 16MB when 3.4 comes out, SERVER-21797).

The documentation on the 'aggregate' helper method says:

Specify subsequent batch sizes to OP_GET_MORE operations as with other MongoDB cursors.

Except that isn't possible either. Even if it were possible to construct an OP_GET_MORE manually in the shell, it requires knowledge of the cursor ID, which is not accessible when using the aggregate helper.

This ticket is a request to expose a batchSize method on cursors returned by the collection object aggregate helper method.

Note that some drivers at least already implement this in a much more natural way; C#, for example, implements a batchSize option to the aggregate method that applies for both the initial command and subsequent getMores, completely abstracting the silly shenanigans going on at the wire protocol.



 Comments   
Comment by Githook User [ 12/Sep/16 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-25551 Pass batchSize through to DBCommandCursor in aggregation helper
Branch: master
https://github.com/mongodb/mongo/commit/f7de898e68c6b17737c7837ea0df5012d7d4830d

Generated at Thu Feb 08 04:09:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.