Table of Contents

Class IndexKeys<TDocument>

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

A builder for specifying the keys for an index.

public static class IndexKeys<TDocument>

Type Parameters

TDocument

The type of the document.

Inheritance
IndexKeys<TDocument>
Inherited Members

Methods

Ascending(params Expression<Func<TDocument, object>>[])

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

Descending(params Expression<Func<TDocument, object>>[])

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

GeoSpatialHaystack<TMember>(Expression<Func<TDocument, TMember>>)

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

GeoSpatialHaystack<TMember, TAdditionalMember>(Expression<Func<TDocument, TMember>>, Expression<Func<TDocument, TAdditionalMember>>)

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

GeoSpatialSpherical<TMember>(Expression<Func<TDocument, TMember>>)

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

GeoSpatial<TMember>(Expression<Func<TDocument, TMember>>)

Sets the key name to create a geospatial index on.

Hashed<TMember>(Expression<Func<TDocument, TMember>>)

Sets the key name to create a hashed index on.

Text(params Expression<Func<TDocument, IEnumerable<string>>>[])

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

Text(params Expression<Func<TDocument, 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.

Wildcard(Expression<Func<TDocument, object>>)

Sets a wildcard key to the index.