License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
MongoDB index API definitions.
IndexModel add(string field, int direction) ref return @safeAdds a single field or multikey index with a direction.IndexModel add(string field, string type) ref return @safeAdds an index with a given index type. Use `IndexType` for a type-safe setting of the string.IndexModel withOptions(IndexOptions options) ref return @safeSets the options member of this IndexModel.Specifies the different index types which are available for index creation.
Nullable!bool backgroundSpecifying 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. ...Nullable!int expireAfterSecondsSpecifies the length in time, in seconds, for documents to remain in a collection.string nameOptionally 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]"Nullable!bool sparseTells the index to only reference documents with the specified field in the index.Nullable!Bson storageEngineAllows configuring the storage engine on a per-index basis.Nullable!bool uniqueForces the index to be unique.Nullable!bool dropDupsCreates a unique index on a field that may have duplicates.Nullable!int version_Specifies the index version number, either 0 or 1.Nullable!string defaultLanguageDefault language for text indexes. Is "english" if none is provided.Nullable!string languageOverrideSpecifies the field in the document to override the language.Nullable!int textIndexVersionSets the text index version number.Nullable!Bson weightsSpecifies fields in the index and their corresponding weight values.Nullable!int _2dsphereIndexVersionSets the 2dsphere index version number.Nullable!int bitsFor 2d indexes, the number of precision of the stored geo hash value of the location data.Nullable!double maxFor 2d indexes, the upper inclusive boundary for the longitude and latitude values.Nullable!double minFor 2d indexes, the lower inclusive boundary for the longitude and latitude values.Nullable!double bucketSizeFor 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 ...Nullable!Bson partialFilterExpressionIf specified, the index only references documents that match the filter expression. See https://docs.mongodb.com/manual/core/index-partial/ for more information.Nullable!Collation collationCollation allows users to specify language-specific rules for string comparison, such as rules for letter-case and accent marks.Nullable!Bson wildcardProjectionAllows users to include or exclude specific field paths from a wildcard index using the `{ "$**": 1 }` key pattern.void expireAfter(Duration d) @safeNullable!long maxTimeMSThe maximum amount of time to allow the index build to take before returning an error. (not implemented)Same as CreateIndexOptions
Nullable!long maxTimeMSThe maximum amount of time to allow the index drop to take before returning an error. (not implemented)Same as DropIndexOptions