[CDRIVER-1053] Make cursor "limit" a signed int64_t Created: 14/Dec/15  Updated: 16/Oct/23

Status: Backlog
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Improvement Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-1054 Support negative cursor limit for sin... Closed
Epic Link: CDRIVER-4742
Backwards Compatibility: Major Change

 Description   

Since the beginning, mongoc_collection_find's "limit" parameter has been unsigned. Negative limits are a useful way to tell the server to send a single batch and close the cursor; there should be a way to communicate a negative limit to the server via the C Driver.

This is an API break; wait for 2.0.

Update the doc for mongoc_cursor_set_limit.



 Comments   
Comment by Patrick Freed [ 23/Jan/20 ]

Is there any way for wrapping drivers to specify a negative limit prior to this change?
Edit: Oh, I see singleBatch is a supported option.

Comment by Githook User [ 27/Jan/16 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-1054: Support negative cursor limit

This adds internal support for specifying a negative cursor limit (i.e. single-batch mode) for both OP_QUERY and find command code paths. Note that this does not change the public API, which will be handled for 2.0 by CDRIVER-1053.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/f8802e35c6dbabc5bf40620c9402f21f7d65ed5b

Comment by Githook User [ 27/Jan/16 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-1054: Support negative cursor limit

This adds internal support for specifying a negative cursor limit (i.e. single-batch mode) for both OP_QUERY and find command code paths. Note that this does not change the public API, which will be handled for 2.0 by CDRIVER-1053.
Branch: r1.3
https://github.com/mongodb/mongo-c-driver/commit/f8802e35c6dbabc5bf40620c9402f21f7d65ed5b

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