.\" This manpage is Copyright (C) 2016 MongoDB, Inc. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.3 .\" or any later version published by the Free Software Foundation; .\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .\" A copy of the license is included in the section entitled "GNU .\" Free Documentation License". .\" .TH "MONGOC_INDEX_OPT_T" "3" "2016\(hy10\(hy12" "MongoDB C Driver" .SH NAME mongoc_index_opt_t \- #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; void *padding[5]; } mongoc_index_opt_t; .SH "SYNOPSIS" .nf .nf #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; void *padding[5]; } mongoc_index_opt_t; .fi .fi .SH "DESCRIPTION" This structure contains the options that may be used for tuning a specific index. See the .B createIndexes documentations in the MongoDB manual for descriptions of individual options. NOTE: 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. .SH "EXAMPLE" .nf { 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, "location", "2d"); geo_opt.twod_location_min = \(hy123; geo_opt.twod_location_max = +123; geo_opt.twod_bits_precision = 30; opt.geo_options = &geo_opt; collection = mongoc_client_get_collection (client, "test", "geo_test"); if (mongoc_collection_create_index(collection, &keys, &opt, &error)) { /* Successfully created the geo index */ } bson_destroy(&keys); mongoc_collection_destroy(&collection); } .fi .SH "SEE ALSO" .B .SH COLOPHON This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.