I'm new to firebase and I don't know how to compare the data in the input fields with the data in firestore. I've searched the firestore documentation for this but can't seem to find it. Would really appreciate the help !
This is the image of the data:
https://i.stack.imgur.com/zAlEG.jpg
db.collection("kaprixlogin")
.add({
users: {
email: "adeel@yahoo.com",
password: "nova",
},
})
.then(function (docRef) {
console.log("Document written with ID: ", docRef.id);
})
.catch(function (error) {
console.error("Error adding document: ", error);
});
db.collection("kaprixlogin")
.get()
.then((snap) => {
snap.forEach((doc) => {
console.log(doc.data());
console.log(doc.id);
});
});
<form method="POST" action="">
<div class="form-label-group">
<input type="email" id="useremail" name="mail" class="form-control" placeholder="Email" required autofocus>
<label for="useremail">Email address</label>
</div>
<div class="form-label-group">
<input type="password" id="inputPassword" name="pass" class="form-control" placeholder="Password" required>
<label for="inputPassword">Password</label>
</div>
</form>