I already read few post on the topic, but for some reason I can not fetch the docs which I need. I have a collection users
with auto generated id and each doc contains name and email. Here is my collection:
Please note, the ids are auto generated.
Then, what I try to do in the code is the following:
firebase.firestore()
.collection("users")
.where(
"id",
"in",
ids
)
.get()
.then((querySnapshot) => {
const people = [];
querySnapshot.forEach(documentSnapshot => {
people.push({
...documentSnapshot.data(),
key: documentSnapshot.id
});
});
console.log("people: ", people);
});
My people
arrays is empty. I am pretty sure that my ids
array has the correct ids. I am not sure if this part is correct:
firebase.firestore()
.collection("users")
.where(
"id",
"in",
ids
)
.get()
Is "id"
the correct name of the auto generated column?