firestore database in user collection:
id1: {
name: 'test',
friends: [
users/id2,
users/id3
]
}
id2: {...}
id3: {...}
I'm trying to receive the snapshots of all references in friends array. (myRef si a reference to users/id1)
const refFriends = (await getDoc(myRef)).data().friends;
const friendsSnaps = await getDocs(refFriends);
console.log(friendsSnaps);
When running, I get this error.
[Unhandled promise rejection: FirebaseError: Expected type 'pc', but it was: an array]
Any ideas?