The situation: I am using MongoDb C# driver. I have an array string[] values. This is the code that I want to make work somehow:
var sort = Builders<Something>.Sort.Descending(x => values.Contains(x.Id));
I have implemented paging for my queries and for some reason I need a SortDefinition which sorts elements with id from a specific collection first and only after that returns other items.
Sadly I realized that Mongo driver Sort which is built in only allows sorting by field definition.