I want to group statistical arrays, and then the condition is the time region, how to achieve
//
// [Error] A pipeline stage specification object must contain exactly one field. at line 1, column 1
db.getCollection("user_reg").aggregate([
{
"$group": {
_id: "$isfrom",
count: {
"$sum": 1
},
},
"$match": {
"regtime": {
"$gte": "2000-01-01",
"$lte": "2020-01-01"
}
}
}
])