mongoc_cursor_set_limit man page

mongoc_cursor_set_limit ā€” mongoc_cursor_set_limit()

Synopsis

bool
mongoc_cursor_set_limit (mongoc_cursor_t *cursor, int64_t limit);

Parameters

Description

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.

Returns

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

Author

MongoDB, Inc

Info

Aug 10, 2017 1.7.0 MongoDB C Driver