Created
September 27, 2019 22:36
-
-
Save matthewoestreich/8822392db84d038a31f6a087170f558f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isUsernameTaken = (username) => { | |
User.find({username: username}) | |
.exec() | |
.then((err, doc) => { | |
if(err) throw err; | |
return doc ? true : false; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment