1MONGOC_COLLECTION_FIND_INDEXES_WITH_lMOiOPbNTmGSoO(nC3g_)oCcOLLECTION_FIND_INDEXES_WITH_OPTS(3)
2
3
4
6 mongoc_collection_find_indexes_with_opts - mongoc_collection_find_in‐
7 dexes_with_opts()
8
10 mongoc_cursor_t *
11 mongoc_collection_find_indexes_with_opts (mongoc_collection_t *collection,
12 const bson_t *opts)
13 BSON_GNUC_WARN_UNUSED_RESULT;
14
15 Fetches a cursor containing documents, each corresponding to an index
16 on this collection.
17
18 This function is considered a retryable read operation. Upon a tran‐
19 sient error (a network error, errors due to replica set failover, etc.)
20 the operation is safely retried once. If retryreads is false in the
21 URI (see mongoc_uri_t) the retry behavior does not apply.
22
24 • collection: A mongoc_collection_t.
25
26 • opts: A bson_t containing additional options.
27
28 opts may be NULL or a BSON document with additional command options:
29
30 • sessionId: First, construct a mongoc_client_session_t with mon‐
31 goc_client_start_session. You can begin a transaction with mon‐
32 goc_client_session_start_transaction, optionally with a mongoc_trans‐
33 action_opt_t that overrides the options inherited from collection,
34 and use mongoc_client_session_append to add the session to opts. See
35 the example code for mongoc_client_session_t.
36
37 • serverId: To target a specific server, include an int32 "serverId"
38 field. Obtain the id by calling mongoc_client_select_server, then
39 mongoc_server_description_id on its return value.
40
42 Use mongoc_cursor_error on the returned cursor to check for errors.
43
45 This function returns a newly allocated mongoc_cursor_t that should be
46 freed with mongoc_cursor_destroy() when no longer in use. The returned
47 mongoc_cursor_t is never NULL, even on error. The user must call mon‐
48 goc_cursor_next() on the returned mongoc_cursor_t to execute the ini‐
49 tial command.
50
51 Cursor errors can be checked with mongoc_cursor_error_document. It al‐
52 ways fills out the bson_error_t if an error occurred, and optionally
53 includes a server reply document if the error occurred server-side.
54
55 WARNING:
56 Failure to handle the result of this function is a programming er‐
57 ror.
58
59 In the returned cursor each result corresponds to the server's repre‐
60 sentation of an index on this collection. If the collection does not
61 exist on the server, the cursor will be empty.
62
63 The cursor functions mongoc_cursor_set_limit, mongoc_cur‐
64 sor_set_batch_size, and mongoc_cursor_set_max_await_time_ms have no use
65 on the returned cursor.
66
68 MongoDB, Inc
69
71 2017-present, MongoDB, Inc
72
73
74
75
761.21.1 MarMO0N2G,OC2_0C2O2LLECTION_FIND_INDEXES_WITH_OPTS(3)