【发布时间】:2019-01-18 23:11:43
【问题描述】:
我如何按 str !null && exists >> bool 为真 >> createDate 是从最新的 到最旧的排序,因为命令?
这是我尝试过的:
// -1 = descending/newest, right?
var sort =
{
"str" : -1, // str will either null, "" or "filled". I don't think this works.
"bool" : -1, // bool will be true or false. Seems to maybe work.
"createDate" : -1 // date obj. Seems to work.
};
【问题讨论】:
标签: javascript mongodb sorting nosql