GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MONGOC_CURSOR_SET_LIMIT(3) libmongoc MONGOC_CURSOR_SET_LIMIT(3)

bool
mongoc_cursor_set_limit (mongoc_cursor_t *cursor, int64_t limit);


  • cursor: A mongoc_cursor_t.
  • limit: The maximum number of documents to retrieve for this query.

Limits the number of documents in the result set.

This function is useful for setting the limit on a cursor after the cursor is created, but before any calls to mongoc_cursor_next(). It can also be used to pass a negative limit: The limit parameter to mongoc_cursor_set_limit is signed, although for backward-compatibility reasons the limit parameter to mongoc_collection_find() is not.

Calling this function after mongoc_cursor_next() has no effect.

This is not applicable to all cursors. Calling mongoc_cursor_set_limit() on a cursor returned by mongoc_client_find_databases_with_opts(), mongoc_database_find_collections_with_opts(), or mongoc_collection_find_indexes_with_opts() will not change the results.

Returns true on success. If any arguments are invalid, returns false and leaves the limit unchanged.

MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.