Question: You want to know how many types of items you have in each category. Which query does this?
- `db.product.group({_id: "$category", count: {$sum:1}})`
- `db.product.aggregate($sum: {_id: "$category", count: {$group:1}})`
- `db.product.aggregate($group: {_id: "$category", count: {$sum:1}})`
- `db.product.aggregate($count: {_id: "$category", count: {$group:1}})`
Answer: The correct answer of the above question is Option C:`db.product.aggregate($group: {_id: "$category", count: {$sum:1}})`