jmcd jmcd - 5 months ago 28
C# Question

How to specify an Order or Sort using the C# driver for MongoDB?

I'm trying to figure out how to sort a collection of documents server side by telling the C# driver what the sort order is, but it appears not to support that construct yet.

Is it possible to do this any other way?

Answer Source

You can also do it using the SetSortOrder method on the MongoCursor class: