Mongo version 3.4 DateToString and Add:
project()
.and(DateOperators.DateToString.dateOf(ArithmeticOperators.Add.valueOf(DATE).add(offsetMilliseconds))
.toString("%Y-%m-%d")).as(DATE_DAYS);
"dateDays": {
"$dateToString": {
"format": "%Y-%m-%d",
"date": {
"$add": ["$date", -36000000]
}
}
}
No comments:
Post a Comment