.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MONGOC_INDEX_OPT_T" "3" "May 07, 2024" "1.27.1" "libmongoc" .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 Deprecated since version 1.8.0: This structure is deprecated and should not be used in new code. See \fI\%Manage Collection Indexes\fP\&. .UNINDENT .UNINDENT .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include typedef struct { bool is_initialized; bool background; bool unique; const char *name; bool drop_dups; bool sparse; int32_t expire_after_seconds; int32_t v; const bson_t *weights; const char *default_language; const char *language_override; mongoc_index_opt_geo_t *geo_options; mongoc_index_opt_storage_t *storage_options; const bson_t *partial_filter_expression; const bson_t *collation; void *padding[4]; } mongoc_index_opt_t; .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp This structure contains the options that may be used for tuning a specific index. .sp See the \fI\%createIndexes documentations\fP in the MongoDB manual for descriptions of individual options. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 dropDups is deprecated as of MongoDB version 3.0.0. This option is silently ignored by the server and unique index builds using this option will fail if a duplicate value is detected. .UNINDENT .UNINDENT .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX { bson_t keys; bson_error_t error; mongoc_index_opt_t opt; mongoc_index_opt_geo_t geo_opt; mongoc_index_opt_init (&opt); mongoc_index_opt_geo_init (&geo_opt); bson_init (&keys); BSON_APPEND_UTF8 (&keys, \(dqlocation\(dq, \(dq2d\(dq); geo_opt.twod_location_min = \-123; geo_opt.twod_location_max = +123; geo_opt.twod_bits_precision = 30; opt.geo_options = &geo_opt; collection = mongoc_client_get_collection (client, \(dqtest\(dq, \(dqgeo_test\(dq); if (mongoc_collection_create_index (collection, &keys, &opt, &error)) { /* Successfully created the geo index */ } bson_destroy (&keys); mongoc_collection_destroy (&collection); } .EE .UNINDENT .UNINDENT .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 .nf \fI\%mongoc_index_opt_geo_t\fP .fi .sp .nf \fI\%mongoc_index_opt_wt_t\fP .fi .sp .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .