1MONGOC_CURSOR_SET_LIMIT(3) MongoDB C Driver MONGOC_CURSOR_SET_LIMIT(3)
2
3
4
6 mongoc_cursor_set_limit - mongoc_cursor_set_limit()
7
9 bool
10 mongoc_cursor_set_limit (mongoc_cursor_t *cursor, int64_t limit);
11
13 · cursor: A mongoc_cursor_t.
14
15 · limit: The maximum number of documents to retrieve for this query.
16
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_collec‐
31 tion_find_indexes_with_opts will not change the results.
32
34 Returns true on success. If any arguments are invalid, returns false
35 and leaves the limit unchanged.
36
38 MongoDB, Inc
39
41 2017-present, MongoDB, Inc
42
43
44
45
461.14.0 Feb 22, 2019 MONGOC_CURSOR_SET_LIMIT(3)