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