Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if email already exists in database using javascript

const userEmail = {emailAddress: email}

const { email } = req.body;

const foundUser = await User.find({ emailAddress: email });

foundUser.length > 0 ? "email already exists" : "email does not exist" 
 
PREVIOUS NEXT
Tagged: #check #email #exists #database #javascript
ADD COMMENT
Topic
Name
3+2 =