Table of Contents

Class SortByBuilder<TDocument>

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

A builder for specifying a sort order.

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

Type Parameters

TDocument

The type of the document.

Inheritance
SortByBuilder<TDocument>
Implements
Inherited Members
Extension Methods

Constructors

SortByBuilder()

Initializes a new instance of the SortByBuilder<TDocument> class.

Methods

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

Adds keys to be sorted by in ascending order.

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

Adds keys to be sorted by in descending order.

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

Adds a key to sort by the computed relevance score when using text search. The name of the key should be the name of the projected relevance score field.

ToBsonDocument()

Converts this object to a BsonDocument.