SyntaxFix
Write A Post
Hire A Developer
Questions
I found a really good option in mongoose that uses distinct returns array all of a specific field in document.
User.find({}).distinct('email').then((err, emails) => { // do something })