Get maximum value from MongoDB aggregation query
I have a list of posts: [{"name: "POST 1", {"name": "POST 2",}, {"name": "POST 1",} I want to count the number of identical names and output the maximum number. The expected result is: {"id: "POST 1", count:2} Now I wrote…