1MONGOC_DATABASE_FIND_COLLECTIONS(3)libmongocMONGOC_DATABASE_FIND_COLLECTIONS(3)
2
3
4
6 Deprecated since version 1.9.0: This function is deprecated and
7 should not be used in new code.
8
9 Please use mongoc_database_find_collections_with_opts() in new code.
10
11
13 mongoc_cursor_t *
14 mongoc_database_find_collections (mongoc_database_t *database,
15 const bson_t *filter,
16 bson_error_t *error)
17 BSON_GNUC_WARN_UNUSED_RESULT
18 BSON_GNUC_DEPRECATED_FOR (mongoc_database_find_collections_with_opts);
19
21 Fetches a cursor containing documents, each corresponding to a collec‐
22 tion on this database.
23
24 This function is considered a retryable read operation. Upon a tran‐
25 sient error (a network error, errors due to replica set failover, etc.)
26 the operation is safely retried once. If retryreads is false in the
27 URI (see mongoc_uri_t) the retry behavior does not apply.
28
30 • database: A mongoc_database_t.
31
32 • filter: A matcher used by the server to filter the returned collec‐
33 tions. May be NULL.
34
35 • error: An optional location for a bson_error_t or NULL.
36
38 Errors are propagated via the error parameter.
39
41 This function returns a newly allocated mongoc_cursor_t that should be
42 freed with mongoc_cursor_destroy() when no longer in use, or NULL in
43 case of error. The user must call mongoc_cursor_next() on the returned
44 mongoc_cursor_t to execute the initial command.
45
46 In the returned cursor each result corresponds to the server's repre‐
47 sentation of a collection in this database.
48
49 The cursor functions mongoc_cursor_set_limit(),
50 mongoc_cursor_set_batch_size(), and
51 mongoc_cursor_set_max_await_time_ms() have no use on the returned cur‐
52 sor.
53
55 MongoDB, Inc
56
58 2017-present, MongoDB, Inc
59
60
61
62
631.25.1 Nov 08, 202M3ONGOC_DATABASE_FIND_COLLECTIONS(3)