【发布时间】:2020-11-23 13:47:27
【问题描述】:
当我想获得两个组合字段时,newAggregation() 中的 project() 应该如何看待?我的收藏包含三个字段:a、b、c。 JS 中的脚本如下所示:
db.collection.aggregate({
$project:
{
"a": "$a",
"new_field": {
"b": "$b",
"c": "$c"
}
}
})
【问题讨论】:
-
这个答案对你有帮助吗
标签: spring mongodb aggregation