Created
January 12, 2014 18:43
-
-
Save aroman/8388628 to your computer and use it in GitHub Desktop.
This file contains 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
User.findOne({"email": req.body.email", function (err, doc) { | |
if (err) { | |
// The query returned an error and we should either ignore | |
// it or do like a 500 error or something. | |
} else { | |
if (doc) { | |
// email exists | |
} else { | |
// email doesn't exist | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment