如何在mongodb aggeragate中将新的Date()转换为扩展的JSON?

时间:2017-06-05 15:58:47

标签: json mongodb mongodb-query aggregation-framework

我在项目中的mongodb聚合中有以下查询部分,它在shell中完美运行,现在我需要将其转换为扩展JSON。

is_older_than_90days: {
$cond: {
    if : {
        $lt: ['$iso_timestamp', (new Date((new Date()).getTime() - (90 * 24 * 60 * 60 * 1000)))]
    },
then: false,
else : true
}

怎么做?

0 个答案:

没有答案