Hi i have sorted collection by EntryDate:
{
"_id" : "5e4a8e13b0b2ddcad37fa308",
"EntryDate" : ISODate("2020-02-17T12:59:00.023Z"),
"Text" : "randomtext"
}
I know EntryDate point. I need take 5 items before and 5 items after this point. Now i do 2 query, can in optimization to 1 query?
var top = col.Find(c.EntryDate < point).SortByDescending(c => c.EntryDate).Limit(5);
var down = col.Find(c.EntryDate > point).Sort(c => c.EntryDate).Limit(5);
var result = top.Concat(down);