Question: You want to know how many types of items you have in each category. Which query does this?

  1. `db.product.group({_id: "$category", count: {$sum:1}})`
  2. `db.product.aggregate($sum: {_id: "$category", count: {$group:1}})`
  3. `db.product.aggregate($group: {_id: "$category", count: {$sum:1}})`
  4. `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}})`