0
$in
クエリをmongoDBの集計とともに作成するにはどうすればよいですか?私は
SELECT name,count(something) from collection1
where name in (<<list of Array>>) and cond1 = 'false'
group by name
$in
クエリをmongoDBの集計とともに作成するにはどうすればよいですか?私は
SELECT name,count(something) from collection1
where name in (<<list of Array>>) and cond1 = 'false'
group by name
同等のmongoクエリの下にSQLの等価MongoDBのクエリを書きたい、次のとおりです。
db.collection1.aggregate([
{ "$match": { "name": { "$in": arrayList } } },
{
"$group": {
"_id": "$name",
"count": { "$sum": "$something" }
}
}
])