I'm using the following aggregate and wanted to see what would be the recommended indexes for this:
{
"$match" :
{
user : ObjectId(user_id),
type : 'item'
}
},
{ "$group" : {
_id : "$user",
size : { "$sum" : "$size" }
}
}
Would it be too much or necessary to do a compound index on user and type, then another compound index on _id and size?