Table of Contents

Method SetSortOrder

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

SetSortOrder(IMongoSortBy)

Sets the sort order for the server to sort the documents by before returning them.

public virtual MongoCursor SetSortOrder(IMongoSortBy sortBy)

Parameters

sortBy IMongoSortBy

The sort order.

Returns

MongoCursor

The cursor (so you can chain method calls to it).

SetSortOrder(params string[])

Sets the sort order for the server to sort the documents by before returning them.

public virtual MongoCursor SetSortOrder(params string[] keys)

Parameters

keys string[]

The names of the fields to sort by.

Returns

MongoCursor

The cursor (so you can chain method calls to it).