How to get Min and Max valus from MongoDb in 1 query?

前端 未结 0 1724
心在旅途
心在旅途 2020-12-10 16:11

I can Get the min and max in 2 Qeurys, but is it possible with C# to do it with 1?

var max = (await collection.Sort(descendingDateTime).Limit(1).FirstOrDefaultAsync()

相关标签:
回答
  • 消灭零回复
提交回复
热议问题