Table of Contents

Class IndexKeysBuilder

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

A builder for specifying the keys for an index.

[Serializable]
[BsonSerializer(typeof(IndexKeysBuilder.Serializer))]
public class IndexKeysBuilder : BuilderBase, IConvertibleToBsonDocument, IMongoIndexKeys
Inheritance
IndexKeysBuilder
Implements
Inherited Members
Extension Methods

Constructors

IndexKeysBuilder()

Initializes a new instance of the IndexKeysBuilder class.

Methods

Ascending(params string[])

Sets one or more key names to index in ascending order.

Descending(params string[])

Sets one or more key names to index in descending order.

GeoSpatial(string)

Sets the key name to create a geospatial index on.

GeoSpatialHaystack(string)

Sets the key name to create a geospatial haystack index on.

GeoSpatialHaystack(string, string)

Sets the key name and additional field name to create a geospatial haystack index on.

GeoSpatialSpherical(string)

Sets the key name to create a spherical geospatial index on.

Hashed(string)

Sets the key name to create a hashed index on.

Text(params string[])

Sets one or more key names to include in the text index.

TextAll()

Create a text index that indexes all text fields of a document.

ToBsonDocument()

Returns the result of the builder as a BsonDocument.

Wildcard(string)

Sets a wildcard key to the index. The method doesn't expect to specify a wildcard key explicitly.