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
9 WARNING:
10 Deprecated since version 1.8.0: This function is deprecated and
11 should not be used in new code. See Manage Collection Indexes.
12
13
15 bool
16 mongoc_collection_create_index_with_opts (mongoc_collection_t *collection,
17 const bson_t *keys,
18 const mongoc_index_opt_t *index_opts,
19 const bson_t *command_opts,
20 bson_t *reply,
21 bson_error_t *error)
22 BSON_GNUC_DEPRECATED;
23
25 • collection: A mongoc_collection_t.
26
27 • keys: A bson_t.
28
29 • index_opts: A mongoc_index_opt_t.
30
31 • reply: An optional location for a bson_t which will store the
32 server's reply.
33
34 • error: An optional location for a bson_error_t or NULL.
35
36 command_opts may be NULL or a BSON document with additional command op‐
37 tions:
38
39 • writeConcern: Construct a mongoc_write_concern_t and use
40 mongoc_write_concern_append() to add the write concern to opts. See
41 the example code for mongoc_client_write_command_with_opts().
42
43 • sessionId: First, construct a mongoc_client_session_t with
44 mongoc_client_start_session(). You can begin a transaction with
45 mongoc_client_session_start_transaction(), optionally with a
46 mongoc_transaction_opt_t that overrides the options inherited from
47 collection, and use mongoc_client_session_append() to add the session
48 to opts. See the example code for mongoc_client_session_t.
49
51 This function will request the creation of a new index.
52
53 This function will use the createIndexes command. The server's reply
54 is stored in reply.
55
56 If no write concern is provided in command_opts, the collection's write
57 concern is used.
58
59 See mongoc_index_opt_t for options on creating indexes.
60
62 Errors are propagated via the error parameter.
63
65 Returns true if successful. Returns false and sets error if there are
66 invalid arguments or a server or network error.
67
68 reply is always initialized and must be destroyed with bson_destroy().
69 If the server is running an obsolete version of MongoDB then reply may
70 be empty, though it will still be initialized.
71
73 MongoDB, Inc
74
76 2017-present, MongoDB, Inc
77
78
79
80
811.24.3 AugMO1N7G,OC2_0C2O3LLECTION_CREATE_INDEX_WITH_OPTS(3)