aggregation framework - MongoDB - How to combine two Sorts -
i want stipulate sort critical point of time: $currentdate. means, sort old dates in descending order, future dates in ascending order.
---future--- 18.5 17.5 16.5 ---today--- 14.5 13.5 12.5 ---past---
to become:
---future--- 16.5 17.5 18.5 ---today-- 14.5 13.5 12.5 ---past---
it's gonna done aggregation framework, might consist of $cond, , prefer begin descending sort take advantage of index. appreciate piece of advice!
Comments
Post a Comment