MongoDB C++ Driver mongocxx-4.0.0
|
#include <mongocxx/v_noabi/mongocxx/options/index.hpp>
Class representing the optional arguments to a MongoDB create index operation.
Classes | |
class | base_storage_options |
Base class representing the optional storage engine options for indexes. More... | |
class | wiredtiger_storage_options |
Class representing the optional WiredTiger storage engine options for indexes. More... | |
Public Member Functions | |
const bsoncxx::v_noabi::stdx::optional< bool > & | background () const |
The current background setting. | |
index & | background (bool background) |
Whether or not to build the index in the background so that building the index does not block other database activities. The default is to build indexes in the foreground. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & | collation () const |
Retrieves the current collation for this index. | |
index & | collation (bsoncxx::v_noabi::document::view collation) |
Sets the collation for this index. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & | default_language () const |
The current default_language setting. | |
index & | default_language (bsoncxx::v_noabi::string::view_or_value default_language) |
For text indexes, the language that determines the list of stop words and the rules for the stemmer and tokenizer. | |
const bsoncxx::v_noabi::stdx::optional< std::chrono::seconds > & | expire_after () const |
The current expire_after setting. | |
index & | expire_after (std::chrono::seconds seconds) |
Set a value, in seconds, as a TTL to control how long MongoDB retains documents in this collection. | |
MONGOCXX_DEPRECATED const bsoncxx::v_noabi::stdx::optional< double > & | haystack_bucket_size () const |
The current haystack_bucket_size setting. | |
MONGOCXX_DEPRECATED index & | haystack_bucket_size (double haystack_bucket_size) |
For geoHaystack indexes, specify the number of units within which to group the location values; i.e. group in the same bucket those location values that are within the specified number of units to each other. | |
const bsoncxx::v_noabi::stdx::optional< bool > & | hidden () const |
The current hidden setting. | |
index & | hidden (bool hidden) |
Whether or not the index is hidden from the query planner. A hidden index is not evaluated as part of query plan selection. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & | language_override () const |
The current name of the field that contains the override language for text indexes. | |
index & | language_override (bsoncxx::v_noabi::string::view_or_value language_override) |
For text indexes, the name of the field, in the collection’s documents, that contains the override language for the document. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & | name () const |
The current name setting. | |
index & | name (bsoncxx::v_noabi::string::view_or_value name) |
The name of the index. | |
operator bsoncxx::v_noabi::document::view_or_value () | |
Conversion operator that provides a view of the options in document form. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & | partial_filter_expression () const |
The current partial_filter_expression setting. | |
index & | partial_filter_expression (bsoncxx::v_noabi::document::view partial_filter_expression) |
Sets the document for the partial filter expression for partial indexes. | |
const bsoncxx::v_noabi::stdx::optional< bool > & | sparse () const |
The current sparse setting. | |
index & | sparse (bool sparse) |
Whether or not to create a sparse index. Sparse indexes only reference documents with the indexed fields. | |
index & | storage_options (std::unique_ptr< base_storage_options > storage_options) |
Optionally used only in MongoDB 3.0.0 and higher. Specifies the storage engine options for the index. | |
index & | storage_options (std::unique_ptr< wiredtiger_storage_options > storage_options) |
Optionally used only in MongoDB 3.0.0 and higher. Specifies the WiredTiger-specific storage engine options for the index. | |
const bsoncxx::v_noabi::stdx::optional< std::uint8_t > & | twod_bits_precision () const |
The current precision of the stored geohash value of the location data. | |
index & | twod_bits_precision (std::uint8_t twod_bits_precision) |
For 2d indexes, the precision of the stored geohash value of the location data. | |
const bsoncxx::v_noabi::stdx::optional< double > & | twod_location_max () const |
The current upper inclusive boundary for the longitude and latitude values. | |
index & | twod_location_max (double twod_location_max) |
For 2d indexes, the upper inclusive boundary for the longitude and latitude values. | |
const bsoncxx::v_noabi::stdx::optional< double > & | twod_location_min () const |
The current lower inclusive boundary for the longitude and latitude values. | |
index & | twod_location_min (double twod_location_min) |
For 2d indexes, the lower inclusive boundary for the longitude and latitude values. | |
const bsoncxx::v_noabi::stdx::optional< std::uint8_t > & | twod_sphere_version () const |
The current twod_sphere_version setting. | |
index & | twod_sphere_version (std::uint8_t twod_sphere_version) |
For 2dsphere indexes, the 2dsphere index version number. Version can be either 1 or 2. | |
const bsoncxx::v_noabi::stdx::optional< bool > & | unique () const |
The current unique setting. | |
index & | unique (bool unique) |
Whether or not to create a unique index so that the collection will not accept insertion of documents where the index key or keys match an existing value in the index. | |
const bsoncxx::v_noabi::stdx::optional< std::int32_t > & | version () const |
The current index version. | |
index & | version (std::int32_t v) |
Sets the index version. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & | weights () const |
The current weights setting. | |
index & | weights (bsoncxx::v_noabi::document::view weights) |
For text indexes, sets the weight document. The weight document contains field and weight pairs. | |
const bsoncxx::v_noabi::stdx::optional< bool > & mongocxx::v_noabi::options::index::background | ( | ) | const |
The current background setting.
index & mongocxx::v_noabi::options::index::background | ( | bool | background | ) |
Whether or not to build the index in the background so that building the index does not block other database activities. The default is to build indexes in the foreground.
background | Whether or not to build the index in the background. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & mongocxx::v_noabi::options::index::collation | ( | ) | const |
Retrieves the current collation for this index.
index & mongocxx::v_noabi::options::index::collation | ( | bsoncxx::v_noabi::document::view | collation | ) |
Sets the collation for this index.
collation | The new collation. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & mongocxx::v_noabi::options::index::default_language | ( | ) | const |
The current default_language setting.
index & mongocxx::v_noabi::options::index::default_language | ( | bsoncxx::v_noabi::string::view_or_value | default_language | ) |
For text indexes, the language that determines the list of stop words and the rules for the stemmer and tokenizer.
default_language | The default language used when creating text indexes. |
const bsoncxx::v_noabi::stdx::optional< std::chrono::seconds > & mongocxx::v_noabi::options::index::expire_after | ( | ) | const |
The current expire_after setting.
index & mongocxx::v_noabi::options::index::expire_after | ( | std::chrono::seconds | seconds | ) |
Set a value, in seconds, as a TTL to control how long MongoDB retains documents in this collection.
seconds | The amount of time, in seconds, to retain documents. |
MONGOCXX_DEPRECATED const bsoncxx::v_noabi::stdx::optional< double > & mongocxx::v_noabi::options::index::haystack_bucket_size | ( | ) | const |
The current haystack_bucket_size setting.
MONGOCXX_DEPRECATED index & mongocxx::v_noabi::options::index::haystack_bucket_size | ( | double | haystack_bucket_size | ) |
For geoHaystack indexes, specify the number of units within which to group the location values; i.e. group in the same bucket those location values that are within the specified number of units to each other.
haystack_bucket_size | The geoHaystack bucket size. |
const bsoncxx::v_noabi::stdx::optional< bool > & mongocxx::v_noabi::options::index::hidden | ( | ) | const |
The current hidden setting.
index & mongocxx::v_noabi::options::index::hidden | ( | bool | hidden | ) |
Whether or not the index is hidden from the query planner. A hidden index is not evaluated as part of query plan selection.
hidden | Whether or not to create a hidden index. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & mongocxx::v_noabi::options::index::language_override | ( | ) | const |
The current name of the field that contains the override language for text indexes.
index & mongocxx::v_noabi::options::index::language_override | ( | bsoncxx::v_noabi::string::view_or_value | language_override | ) |
For text indexes, the name of the field, in the collection’s documents, that contains the override language for the document.
language_override | The name of the field that contains the override language for text indexes. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & mongocxx::v_noabi::options::index::name | ( | ) | const |
The current name setting.
index & mongocxx::v_noabi::options::index::name | ( | bsoncxx::v_noabi::string::view_or_value | name | ) |
The name of the index.
name | The name of the index. |
mongocxx::v_noabi::options::index::operator bsoncxx::v_noabi::document::view_or_value | ( | ) |
Conversion operator that provides a view of the options in document form.
mongocxx::v_noabi::logic_error | if an invalid expireAfterSeconds field is provided. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & mongocxx::v_noabi::options::index::partial_filter_expression | ( | ) | const |
The current partial_filter_expression setting.
index & mongocxx::v_noabi::options::index::partial_filter_expression | ( | bsoncxx::v_noabi::document::view | partial_filter_expression | ) |
Sets the document for the partial filter expression for partial indexes.
partial_filter_expression | The partial filter expression document. |
const bsoncxx::v_noabi::stdx::optional< bool > & mongocxx::v_noabi::options::index::sparse | ( | ) | const |
The current sparse setting.
index & mongocxx::v_noabi::options::index::sparse | ( | bool | sparse | ) |
Whether or not to create a sparse index. Sparse indexes only reference documents with the indexed fields.
sparse | Whether or not to create a sparse index. |
index & mongocxx::v_noabi::options::index::storage_options | ( | std::unique_ptr< base_storage_options > | storage_options | ) |
Optionally used only in MongoDB 3.0.0 and higher. Specifies the storage engine options for the index.
storage_options | The storage engine options for the index. |
index & mongocxx::v_noabi::options::index::storage_options | ( | std::unique_ptr< wiredtiger_storage_options > | storage_options | ) |
Optionally used only in MongoDB 3.0.0 and higher. Specifies the WiredTiger-specific storage engine options for the index.
storage_options | The storage engine options for the index. |
const bsoncxx::v_noabi::stdx::optional< std::uint8_t > & mongocxx::v_noabi::options::index::twod_bits_precision | ( | ) | const |
The current precision of the stored geohash value of the location data.
index & mongocxx::v_noabi::options::index::twod_bits_precision | ( | std::uint8_t | twod_bits_precision | ) |
For 2d indexes, the precision of the stored geohash value of the location data.
twod_bits_precision | The precision of the stored geohash value. |
const bsoncxx::v_noabi::stdx::optional< double > & mongocxx::v_noabi::options::index::twod_location_max | ( | ) | const |
The current upper inclusive boundary for the longitude and latitude values.
index & mongocxx::v_noabi::options::index::twod_location_max | ( | double | twod_location_max | ) |
For 2d indexes, the upper inclusive boundary for the longitude and latitude values.
twod_location_max | The upper inclusive boundary. |
const bsoncxx::v_noabi::stdx::optional< double > & mongocxx::v_noabi::options::index::twod_location_min | ( | ) | const |
The current lower inclusive boundary for the longitude and latitude values.
index & mongocxx::v_noabi::options::index::twod_location_min | ( | double | twod_location_min | ) |
For 2d indexes, the lower inclusive boundary for the longitude and latitude values.
twod_location_min | The lower inclusive boundary. |
const bsoncxx::v_noabi::stdx::optional< std::uint8_t > & mongocxx::v_noabi::options::index::twod_sphere_version | ( | ) | const |
The current twod_sphere_version setting.
index & mongocxx::v_noabi::options::index::twod_sphere_version | ( | std::uint8_t | twod_sphere_version | ) |
For 2dsphere indexes, the 2dsphere index version number. Version can be either 1 or 2.
twod_sphere_version | The 2dsphere index version number. |
const bsoncxx::v_noabi::stdx::optional< bool > & mongocxx::v_noabi::options::index::unique | ( | ) | const |
The current unique setting.
index & mongocxx::v_noabi::options::index::unique | ( | bool | unique | ) |
Whether or not to create a unique index so that the collection will not accept insertion of documents where the index key or keys match an existing value in the index.
unique | Whether or not to create a unique index. |
const bsoncxx::v_noabi::stdx::optional< std::int32_t > & mongocxx::v_noabi::options::index::version | ( | ) | const |
The current index version.
index & mongocxx::v_noabi::options::index::version | ( | std::int32_t | v | ) |
Sets the index version.
v | The index version. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view > & mongocxx::v_noabi::options::index::weights | ( | ) | const |
The current weights setting.
index & mongocxx::v_noabi::options::index::weights | ( | bsoncxx::v_noabi::document::view | weights | ) |
For text indexes, sets the weight document. The weight document contains field and weight pairs.
weights | The weight document for text indexes. |