How to use the distinct count query in MongoDB
Displaying a specific number of documents in a particular collection is one of the retrieval queries. Use the distinct count query when you have hundreds of documents in a collection and want to know the total number of distinct documents in that collection.
Source: FOSS Linux