I am trying to use Aggregate and $group to do an averaging.
But I am having this error "Error: Line 5: Unexpected token }"
I am struggling to get the correct brackets in place. Appreciate if anyone can assist.
db.db1.aggregate([
{$match:{"budget":"medium"}},
{$group:{
"_id":{"budget":"$budget"},
"AvgBirthYear":{$avg:{"$birth_year"}}
}
}
])
