MongoDB骨料,具有总和和最小树状结构
如何仅显示计数大于10的结果MongoDB骨料,具有总和和最小树状结构,mongodb,aggregation-framework,Mongodb,Aggregation Framework,如何仅显示计数大于10的结果 db.mydate.aggregate( [ { $group : { _id : "Ident.url", count: { $sum: 1 } } } ] ) 谢谢大家! 您可以在组后使用$match进行筛选 db.mydate.aggregate( [ { $group : { _id :
db.mydate.aggregate(
[
{
$group : {
_id : "Ident.url",
count: { $sum: 1 }
}
}
]
)
谢谢大家! 您可以在组后使用$match进行筛选
db.mydate.aggregate(
[
{
$group : {
_id : "Ident.url",
count: { $sum: 1 }
}
},
{$match: {count: {$gt:10}}}
]
)
尝试使用
match
过滤计数:
db.mydate.aggregate(
[
{
$group : {
_id : "Ident.url",
count: { $sum: 1 }
}
},
{
$match : {
count: {
$gt: 10
}
}
}
]
)
类似于
{$match:{$count:{$gt:10}}}