How does Query.prototype.distinct() work in Mongoose?
The Query.prototype.distinct() function declares or executes a distinct() operation. And if we pass a callback, then the query executes.Syntax: Query.prototype.distinct() Parameters: This function has three optional parameters ie. field, filter and callback function.Return Value: This function retur