Slide 23
Slide 23 text
What the command looks like…
{
"aggregate"
:
"scores"
,
"pipeline"
:
[
{
"$match"
:
{
"year"
:
"junior"}}
,
{
"$project"
:
{
"name"
:
1
,
"score"
:
1
,
"_id"
:
0}}
,
{
"$group"
:
{
"_id"
:
"$name"
,
"average"
:
{
"$avg"
:
"$score"}
}
}
]
}