0

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

Ace
  • 1,028
  • 2
  • 10
  • 22

3 Answers3

2

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
0

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?

Darrow Hartman
  • 4,142
  • 2
  • 17
  • 36
  • I use firestoreConnect to allow components to be loaded with firestore data as props. Logically, the collections I query from would be in a hierarchy, but as I need to query across all docs of each collection, I keep them all as top level collections. If firestoreConnect has been updated to include this feature, I could store my collections underneath each other as desired. – Ace May 17 '19 at 03:15
0
//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
  );