【发布时间】:2020-06-18 15:14:47
【问题描述】:
对于这个查询
Aggregation aggregation = Aggregation.newAggregation(
match(Criteria.where("userId").is(accountId)
.and("processingDay").gte(startMillis).lte(endMillis)),
sort(Sort.Direction.valueOf("ASC"), "x1"),
sort(Sort.Direction.valueOf("ASC"), "x2"),
Aggregation.group("A", "state")
.push(new BasicDBObject("x1", "$x1")
.append("x2", "$x2")
.append("A", "$A")
).as("XS"));
结果为@987654322@,A为空的地方怎么填?
【问题讨论】:
-
“如何填充一个值为null的值?”:用what值填充?没有
null的典型输出是什么?您是否考虑排除字段A?
标签: spring mongodb nosql aggregation-framework spring-data-mongodb