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
-
I have a Firestore collection called
Locations
. It has a subcollection calledPeriods
. I'm using Nuxt (no SSR) with Pinia.The
Locations
store is correctly subscribing to the corresponding collection when usinguseCollection
with a computed source: it's showing up in Vue Dev Tools as a filled array. However, thePeriods
one does not subscribe to the collection or get populated. It also usesuseCollection
and a computed source. The source is based off theLocations
collection.My source function uses a variation of the computed property
contactSource
logic from the docs:Note: I'm also using the
target
option.So I'm wondering if it's because in order to populate the
Periods
store 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
periodsColRef
andperiodsQuery
are being computed correctly, butperiodsCol
is not.Beta Was this translation helpful? Give feedback.
All reactions