Scroll to navigation

MONGOC_CURSOR_SET_LIMIT(3) Library Functions Manual MONGOC_CURSOR_SET_LIMIT(3)

NAME

mongoc_cursor_set_limit() - Limits the number of documents in the result set.

SYNOPSIS


bool mongoc_cursor_set_limit (mongoc_cursor_t *cursor, int64_t limit);

PARAMETERS

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

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 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

True if the limit was set.

COLOPHON

This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
2016‐10‐12 MongoDB C Driver