db.getCollection('post').find({'post_no':47}, {'comment': 1})
The resulting values are:
{
"_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
}
]
}
I want to get the maximum value 4 of the comment_group.
What can I do?
Thank you for your advice.