How to "chain" a subcollection with useCollection and target? #1426
Unanswered
davidstackio
asked this question in
Questions and Help
Replies: 2 comments 4 replies
-
|
I think you might be interested in #153 |
Beta Was this translation helpful? Give feedback.
4 replies
-
I found this useful regarding the SSR warning: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Firestore collection called
Locations. It has a subcollection calledPeriods. I'm using Nuxt (no SSR) with Pinia.The
Locationsstore is correctly subscribing to the corresponding collection when usinguseCollectionwith a computed source: it's showing up in Vue Dev Tools as a filled array. However, thePeriodsone does not subscribe to the collection or get populated. It also usesuseCollectionand a computed source. The source is based off theLocationscollection.My source function uses a variation of the computed property
contactSourcelogic from the docs:Note: I'm also using the
targetoption.So I'm wondering if it's because in order to populate the
Periodsstore collection, it needs the collection information fromLocations(hence the "chain" in the title).BUT, the source is being computed correctly - just the collection is not.
What am I missing?
Here is the logic:
LocationStore.ts
Everything works as expected here.
PeriodStore.ts
periodsColRefandperiodsQueryare being computed correctly, butperiodsColis not.Beta Was this translation helpful? Give feedback.
All reactions