Aggregation pipeline

Hey @Jain_Shah

I think you are looking for something like the following

db.getCollection("products").aggregate([
	{ $match: { product: "Stop Watch" } },
	{
		$group: {
			_id: { related: "$related", product: "$title" },
			count: { $sum: 1 }
		}
	}
]);