1MONGOC_CURSOR_SET_LIMIT(3)         libmongoc        MONGOC_CURSOR_SET_LIMIT(3)
2
3
4

NAME

6       mongoc_cursor_set_limit - mongoc_cursor_set_limit()
7

SYNOPSIS

9          bool
10          mongoc_cursor_set_limit (mongoc_cursor_t *cursor, int64_t limit);
11

PARAMETERS

13cursor: A mongoc_cursor_t.
14
15limit: The maximum number of documents to retrieve for this query.
16

DESCRIPTION

18       Limits the number of documents in the result set.
19
20       This  function  is  useful  for setting the limit on a cursor after the
21       cursor is created, but before any calls to mongoc_cursor_next.  It  can
22       also  be  used  to  pass  a negative limit: The limit parameter to mon‐
23       goc_cursor_set_limit is  signed,  although  for  backward-compatibility
24       reasons the limit parameter to mongoc_collection_find is not.
25
26       Calling this function after mongoc_cursor_next has no effect.
27
28       This  is not applicable to all cursors. Calling mongoc_cursor_set_limit
29       on a cursor returned  by  mongoc_client_find_databases_with_opts,  mon‐
30       goc_database_find_collections_with_opts,  or mongoc_collection_find_in‐
31       dexes_with_opts will not change the results.
32

RETURNS

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

AUTHOR

38       MongoDB, Inc
39
41       2017-present, MongoDB, Inc
42
43
44
45
461.20.0                           Nov 18, 2021       MONGOC_CURSOR_SET_LIMIT(3)
Impressum