Skip to content

Settings and activity

1 result found

  1. 1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  General » Firestore  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Rob Molloy commented  · 

    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),
    ),
    )

    An error occurred while saving the comment
    Rob Molloy commented  · 

    I 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  ·