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