IndexOptions

Members

Functions

expireAfter
void expireAfter(Duration d)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_2dsphereIndexVersion
Nullable!int _2dsphereIndexVersion;

Sets the 2dsphere index version number.

background
Nullable!bool background;

Specifying true directs MongoDB to build the index in the background. Background builds do not block operations on the collection. Since MongoDB 4.2 indices are built on the background by default. In MongoDB 4.0 and before, this defaults to false.

bits
Nullable!int bits;

For 2d indexes, the number of precision of the stored geo hash value of the location data.

bucketSize
Nullable!double bucketSize;

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.

collation
Nullable!Collation collation;

Collation allows users to specify language-specific rules for string comparison, such as rules for letter-case and accent marks.

defaultLanguage
Nullable!string defaultLanguage;

Default language for text indexes. Is "english" if none is provided.

dropDups
Nullable!bool dropDups;

Creates a unique index on a field that may have duplicates.

expireAfterSeconds
Nullable!int expireAfterSeconds;

Specifies the length in time, in seconds, for documents to remain in a collection.

languageOverride
Nullable!string languageOverride;

Specifies the field in the document to override the language.

max
Nullable!double max;

For 2d indexes, the upper inclusive boundary for the longitude and latitude values.

min
Nullable!double min;

For 2d indexes, the lower inclusive boundary for the longitude and latitude values.

name
string name;

Optionally specify a specific name for the index outside of the default generated name. If none is provided then the name is generated in the format "field_direction"

partialFilterExpression
Nullable!Bson partialFilterExpression;

If specified, the index only references documents that match the filter expression. See Partial Indexes for more information.

sparse
Nullable!bool sparse;

Tells the index to only reference documents with the specified field in the index.

storageEngine
Nullable!Bson storageEngine;

Allows configuring the storage engine on a per-index basis.

textIndexVersion
Nullable!int textIndexVersion;

Sets the text index version number.

unique
Nullable!bool unique;

Forces the index to be unique.

version_
Nullable!int version_;

Specifies the index version number, either 0 or 1.

weights
Nullable!Bson weights;

Specifies fields in the index and their corresponding weight values.

wildcardProjection
Nullable!Bson wildcardProjection;

Allows users to include or exclude specific field paths from a wildcard index using the { "$**": 1 } key pattern.

See Also

Meta