Settings and activity
1 result found
-
1 vote
An error occurred while saving the comment An error occurred while saving the comment Rob Molloy commentedI didn't want to pollute the above request but potentially you would need to duplicate the id on each doc in the profiles collection. This would ensure you are returning only the correct profile. The query would like this;
```
getDocs(
query(
collection(db, "profiles"),
where("id", "==", "profileId1"),
where("groupProfileLinkIdReference", "array-contains", "groupProfileLinkId1"),
limit(1),
),
)
```Rob Molloy shared this idea ·
I still think this is a good idea but it can be resolved using a map instead of an array;
```
getDocs(
query(
collection(db, "profiles"),
where(`groupProfileLinkIdReference.${groupProfileLink1.id}`, "==", "groupProfileLinkId1"),
limit(1),
),
)