Ace
Ace

Reputation: 1146

Can I query across subcollections with firestoreConnect?

I read that Firestore can now query across subcollections. Is the firestoreConnect HOC from react-redux-firebase capable of utilizing this feature?

Upvotes: 0

Views: 463

Answers (3)

Izzy Glen
Izzy Glen

Reputation: 1

//To query all subcolections with react-redux-firebase useFirestoreConnect function, use:

useFirestoreConnect([
    {
      collectionGroup: "COLLECTION_GROUP_NAME",
      storeAs: "ANY_NAME",
    },
  ]);


//To Read and save to a variable

  let YOUR_VAR = useSelector(
    (state) => state.firestore.ordered.ANY_NAME
  );

Upvotes: 0

Frank van Puffelen
Frank van Puffelen

Reputation: 599601

Collection Group Queries were released at Google I/O last week (May 7, 2019). A quick scan of the react-redux-firebase release notes shows no mention of them at this time, so it seems like they're not supported yet. You might want to file an issue/feature request for it and monitor said release notes for updates.

Upvotes: 2

Darrow Hartman
Darrow Hartman

Reputation: 4373

I read about that too. There is info about how to perform subcollection queries here: Link. I am not sure about react-redux however, what are your intentions?

Upvotes: 0

Related Questions