[CDRIVER-267] Streamline limit / batchSize Created: 03/Dec/13  Updated: 19/Oct/16  Resolved: 30/Dec/13

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 0.92.0

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: Christian Hergert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-982 "limit" not used in OP_QUERY message ... Closed
Backwards Compatibility: Major Change

 Description   

Limit isn't sanely handled at the moment.

  • limit get's mapped to n_return, but it isn't quite
  • batch_size get's used in some places, limit in others
  • there's no way to pass batch_size via _find()

We should clean up our handling across the board by either exposing both parameters or directly exposing the wire protocol semantics for numberToReturn



 Comments   
Comment by Christian Hergert [ 30/Dec/13 ]

Committed to master.

This is an ABI break.

Comment by Mira Carey [ 20/Dec/13 ]

Okay, managed an actual solution. Now with actual limit support!

https://github.com/mongodb/mongo-c-driver/commit/9f74b20c212f2ad2e6b5f056d35856f6e82ee453

Comment by Mira Carey [ 19/Dec/13 ]

Thinking about this some more, I just ditched that commit. We need actual support for limit on cursors. I'd forgotten that limit really only lives in user space. $maxScan isn't a substitute.

I'll just bite the bullet and add actual support.

Comment by Mira Carey [ 19/Dec/13 ]

$maxScan is fine with exhaust cursors... Need to remove a bad check

Comment by Mira Carey [ 19/Dec/13 ]

Changeset here. Basically, just ditched limit for now (folks can directly inline $maxScan). renamed n_return to batch_size

https://github.com/mongodb/mongo-c-driver/commit/906e97bc4dae679550583aed0c976f238a31225c

Generated at Wed Feb 07 21:08:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.