【发布时间】:2018-10-12 09:47:46
【问题描述】:
db.getCollection('post').find({'post_no':47}, {'comment': 1})
结果值为:
{
"_id" : ObjectId("5bc05c038e798ccb0309658b"),
"comment" : [
{
"comment_no" : 112
},
{
"comment_no" : 113,
"comment_group" : 1
},
{
"comment_no" : 116,
"comment_group" : 2
},
{
"comment_no" : 117,
"comment_group" : 3
},
{
"comment_group" : 4,
"comment_no" : 118
}
]
}
我想得到comment_group的最大值4。
我能做什么?
感谢您的建议。
【问题讨论】:
标签: mongodb aggregation-framework max