vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Struct IndexOptions

struct IndexOptions ;

Fields

NameTypeDescription
_2dsphereIndexVersion std.typecons.Nullable!(int)Sets the 2dsphere index version number.
background std.typecons.Nullable!(bool)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 std.typecons.Nullable!(int)For 2d indexes, the number of precision of the stored geo hash value of the location data.
bucketSize std.typecons.Nullable!(double)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 std.typecons.Nullable!(vibe.db.mongo.collection.Collation)Collation allows users to specify language-specific rules for string comparison, such as rules for letter-case and accent marks.
defaultLanguage std.typecons.Nullable!(string)Default language for text indexes. Is "english" if none is provided.
dropDups std.typecons.Nullable!(bool)Creates a unique index on a field that may have duplicates.
expireAfterSeconds std.typecons.Nullable!(int)Specifies the length in time, in seconds, for documents to remain in a collection.
languageOverride std.typecons.Nullable!(string)Specifies the field in the document to override the language.
max std.typecons.Nullable!(double)For 2d indexes, the upper inclusive boundary for the longitude and latitude values.
min std.typecons.Nullable!(double)For 2d indexes, the lower inclusive boundary for the longitude and latitude values.
name stringOptionally 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 std.typecons.Nullable!(vibe.data.bson.Bson)If specified, the index only references documents that match the filter expression. See Partial Indexes for more information.
sparse std.typecons.Nullable!(bool)Tells the index to only reference documents with the specified field in the index.
storageEngine std.typecons.Nullable!(vibe.data.bson.Bson)Allows configuring the storage engine on a per-index basis.
textIndexVersion std.typecons.Nullable!(int)Sets the text index version number.
unique std.typecons.Nullable!(bool)Forces the index to be unique.
version_ std.typecons.Nullable!(int)Specifies the index version number, either 0 or 1.
weights std.typecons.Nullable!(vibe.data.bson.Bson)Specifies fields in the index and their corresponding weight values.
wildcardProjection std.typecons.Nullable!(vibe.data.bson.Bson)Allows users to include or exclude specific field paths from a wildcard index using the { "$**": 1 } key pattern.

Methods

NameDescription
expireAfter (d)

See Also

https://docs.mongodb.com/manual/reference/command/createIndexes/

Standards

https://github.com/mongodb/specifications/blob/0c6e56141c867907aacf386e0cbe56d6562a0614/source/index-management.rst#common-api-components

Authors

Jan Jurzitza

Copyright

© 2020-2022 Jan Jurzitza

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.