Table of Contents

Method Ascending

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Ascending<TDocument>(IndexKeysDefinition<TDocument>, FieldDefinition<TDocument>)

Combines an existing index keys definition with an ascending index key definition.

public static IndexKeysDefinition<TDocument> Ascending<TDocument>(this IndexKeysDefinition<TDocument> keys, FieldDefinition<TDocument> field)

Parameters

keys IndexKeysDefinition<TDocument>

The keys.

field FieldDefinition<TDocument>

The field.

Returns

IndexKeysDefinition<TDocument>

A combined index keys definition.

Type Parameters

TDocument

The type of the document.

Ascending<TDocument>(IndexKeysDefinition<TDocument>, Expression<Func<TDocument, object>>)

Combines an existing index keys definition with an ascending index key definition.

public static IndexKeysDefinition<TDocument> Ascending<TDocument>(this IndexKeysDefinition<TDocument> keys, Expression<Func<TDocument, object>> field)

Parameters

keys IndexKeysDefinition<TDocument>

The keys.

field Expression<Func<TDocument, object>>

The field.

Returns

IndexKeysDefinition<TDocument>

A combined index keys definition.

Type Parameters

TDocument

The type of the document.