Table of Contents

Class IndexOptionsBuilder<TDocument>

Namespace
MongoDB.Driver.Builders
Assembly
MongoDB.Driver.Legacy.dll

A builder for the options used when creating an index.

[Serializable]
[BsonSerializer(typeof(IndexOptionsBuilder<>.Serializer))]
public class IndexOptionsBuilder<TDocument> : BuilderBase, IConvertibleToBsonDocument, IMongoIndexOptions

Type Parameters

TDocument

The type of the document.

Inheritance
IndexOptionsBuilder<TDocument>
Implements
Inherited Members
Extension Methods

Constructors

IndexOptionsBuilder()

Initializes a new instance of the IndexOptionsBuilder class.

Methods

SetBackground(bool)

Sets whether to build the index in the background.

SetBits(int)

Sets the location precision bits.

SetBucketSize(double)

Sets the bucket size for geospatial haystack indexes.

SetDropDups(bool)

Sets whether duplicates should be dropped.

SetGeoSpatialRange(double, double)

Sets the geospatial range.

SetHidden(bool)

Sets whether the index is hidden.

SetName(string)

Sets the name of the index.

SetPartialFilterExpression(IMongoQuery)

Sets the partial filter expression.

SetSparse(bool)

Sets whether the index is a sparse index.

SetStorageEngineOptions(BsonDocument)

Sets the storage engine options.

SetTextDefaultLanguage(string)

Sets the default language for the text index.

SetTextLanguageOverride(Expression<Func<TDocument, string>>)

Specifies a member expression for the field name containing the language for the text index.

SetTimeToLive(TimeSpan)

Sets the time to live value.

SetUnique(bool)

Sets whether the index enforces unique values.

SetWeight<TMember>(Expression<Func<TDocument, TMember>>, int)

Sets the weight of a field for the text index.

SetWildcardProjection<TMember>(Expression<Func<TDocument, TMember>>, bool)

Sets the wildcardProjection for the index.

ToBsonDocument()

Converts this object to a BsonDocument.