Need help searching for a value in firestore
问题 I'm new to firestore and I'm making a register page with vue. Before a new user is made, it has to check if the given username already exists or not and if not, make a new user. I can add a new user to the database, but I don't know how to check if the username already exists or not. I tried a lot of things and this is the closest I've gotten: db.collection("Users") .get() .then(querySnapshot => { querySnapshot.forEach(doc => { if (this.username === doc.data().username) { usernameExist = true