1MONGOC_COLLECTION_CREATE_INDEX_WITH_lMOiOPbNTmGSoO(nC3g_)oCcOLLECTION_CREATE_INDEX_WITH_OPTS(3)
2
3
4
6 mongoc_collection_create_index_with_opts - mongoc_collection_create_in‐
7 dex_with_opts()
8
10 bool
11 mongoc_collection_create_index_with_opts (mongoc_collection_t *collection,
12 const bson_t *keys,
13 const mongoc_index_opt_t *index_opts,
14 const bson_t *command_opts,
15 bson_t *reply,
16 bson_error_t *error);
17
19 This function is deprecated and should not be used in new code. See
20 create-indexes.
21
23 • collection: A mongoc_collection_t.
24
25 • keys: A bson_t.
26
27 • index_opts: A mongoc_index_opt_t.
28
29 • reply: An optional location for a bson_t which will store the
30 server's reply.
31
32 • error: An optional location for a bson_error_t or NULL.
33
34 command_opts may be NULL or a BSON document with additional command op‐
35 tions:
36
37 • writeConcern: Construct a mongoc_write_concern_t and use mon‐
38 goc_write_concern_append to add the write concern to opts. See the
39 example code for mongoc_client_write_command_with_opts.
40
41 • sessionId: First, construct a mongoc_client_session_t with mon‐
42 goc_client_start_session. You can begin a transaction with mon‐
43 goc_client_session_start_transaction, optionally with a mongoc_trans‐
44 action_opt_t that overrides the options inherited from collection,
45 and use mongoc_client_session_append to add the session to opts. See
46 the example code for mongoc_client_session_t.
47
49 This function will request the creation of a new index.
50
51 This function will use the createIndexes command. The server's reply
52 is stored in reply.
53
54 If no write concern is provided in command_opts, the collection's write
55 concern is used.
56
57 See mongoc_index_opt_t for options on creating indexes.
58
60 Errors are propagated via the error parameter.
61
63 Returns true if successful. Returns false and sets error if there are
64 invalid arguments or a server or network error.
65
66 reply is always initialized and must be destroyed with bson_destroy().
67 If the server is running an obsolete version of MongoDB then reply may
68 be empty, though it will still be initialized.
69
71 MongoDB, Inc
72
74 2017-present, MongoDB, Inc
75
76
77
78
791.21.1 MarMO0N2G,OC2_0C2O2LLECTION_CREATE_INDEX_WITH_OPTS(3)