... | @@ -138,3 +138,19 @@ const getUser = async (email) => { |
... | @@ -138,3 +138,19 @@ const getUser = async (email) => { |
|
}
|
|
}
|
|
};
|
|
};
|
|
```
|
|
```
|
|
|
|
|
|
|
|
**_Outra maneira_**
|
|
|
|
```
|
|
|
|
const usersCollection = db.collection("User");
|
|
|
|
const querySnapshot = await usersCollection
|
|
|
|
.where("email", "==", email)
|
|
|
|
.limit(1)
|
|
|
|
.get();
|
|
|
|
|
|
|
|
if (querySnapshot.exists()) {
|
|
|
|
console.log("Usuário encontrado:", querySnapshot.data());
|
|
|
|
}else{
|
|
|
|
console.log("Nenhum usuário encontrado.");
|
|
|
|
}
|
|
|
|
```
|
|
|
|
``` |