MongoDB sort data by most number of records
I want to sort with the most occurrences of any value in a collection. Eg. { "id": "ID", "fruit": 'Apple' }, { "id": "ID", "fruit": 'Banana' }, { "id": "ID", "fruit": 'Apple' }, { "id": "ID", "fruit": 'Orange' }, {…