1MONGOC_CLIENT_FIND_DATABASES_WITH_OPlTiSbM(mO3oN)nGgOoCc_CLIENT_FIND_DATABASES_WITH_OPTS(3)
2
3
4
6 mongoc_cursor_t *
7 mongoc_client_find_databases_with_opts (
8 mongoc_client_t *client, const bson_t *opts) BSON_GNUC_WARN_UNUSED_RESULT;
9
10 Fetches a cursor containing documents, each corresponding to a database
11 on this MongoDB server.
12
13 This function is considered a retryable read operation. Upon a tran‐
14 sient error (a network error, errors due to replica set failover, etc.)
15 the operation is safely retried once. If retryreads is false in the
16 URI (see mongoc_uri_t) the retry behavior does not apply.
17
19 • client: A mongoc_client_t.
20
21 • opts: A bson_t containing additional options.
22
23 opts may be NULL or a BSON document with additional command options:
24
25 • sessionId: First, construct a mongoc_client_session_t with
26 mongoc_client_start_session(). You can begin a transaction with
27 mongoc_client_session_start_transaction(), optionally with a
28 mongoc_transaction_opt_t that overrides the options inherited from
29 client, and use mongoc_client_session_append() to add the session to
30 opts. See the example code for mongoc_client_session_t.
31
32 • serverId: To target a specific server, include an int32 "serverId"
33 field. Obtain the id by calling mongoc_client_select_server(), then
34 mongoc_server_description_id() on its return value.
35
36 For a list of all options, see the MongoDB Manual entry on the list‐
37 Databases command.
38
40 Use mongoc_cursor_error() on the returned cursor to check for errors.
41
43 A cursor where each result corresponds to the server's representation
44 of a database.
45
46 The cursor functions mongoc_cursor_set_limit(),
47 mongoc_cursor_set_batch_size(), and
48 mongoc_cursor_set_max_await_time_ms() have no use on the returned cur‐
49 sor.
50
52 MongoDB, Inc
53
55 2017-present, MongoDB, Inc
56
57
58
59
601.25.1 Nov 0M8O,NG2O0C2_3CLIENT_FIND_DATABASES_WITH_OPTS(3)