Skip to content

Instantly share code, notes, and snippets.

@aroman
Created January 12, 2014 18:43
Show Gist options
  • Save aroman/8388628 to your computer and use it in GitHub Desktop.
Save aroman/8388628 to your computer and use it in GitHub Desktop.
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