运维网's Archiver
论坛
›
Mongodb
› 【MongoDB】使用aggregate求最大值
搜诶符合你
发表于 2018-10-25 13:52:16
【MongoDB】使用aggregate求最大值
db.collection.aggregate({
$group:{
_id:"$id",//"$_id"代表引用集合中_id列
max_value:{$max:"$times"} //"$times"代表引用集合中times列
},
$match:{times:{$gte:100}}
})
页:
[1]
查看完整版本:
【MongoDB】使用aggregate求最大值