i have problem to get the document's id that automatically created and its specific value from in firestore database. here the firestore database that i have also the code that i tried to: firestoredb
app.post("/Register", (req, res) => {
const {
name,
email,
password,
phone,
} = req.body;
const balance = 0;
const lowEmail = email.toLowerCase();
const valAcc = db.collection("Users");
const valueEmail = valAcc.getString(lowEmail);
if (valueEmail === lowEmail) {
res.status(400).send("Email already exists");
}
db.collection("Users").add({
Name: name,
Email: lowEmail,
Password: password,
Phone: phone,
Balance: balance,
});
res.status(201).send();
});
And i am using it for making api with node.js. any solution for this? i tried to search for it but i didnt get it. Any help will be very valuable. Thank you.