Reactive useCollection query not updated when docs change on the server. #1488
Unanswered
manuelmypan
asked this question in
Questions and Help
Replies: 1 comment
-
You are just missing the const accountId = ref('')
const botsCollection = useCollection(computed(() =>
query(
collection(db, 'chatBots'),
where('accountId', '==', accountId.value)
)
), {
ssrKey: 'chatBots'
}) You can also just pass the function rather than the computed. |
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.
-
Hello everyone,
I am rather new to vue and vuefire...
I'm struggling to get a reactive useCollection with a query to work, so that I get the changes on the client side if documents on the server change.
My simplified code looks something like this:
Even if I remove the where clause, I still don't get any updates.
I will get the initial documents, but if I change the content of a document on the server side or add a new one, botsCollection is never updated (checked with a watch on botsCollection).
On single docs (using useDocument) it works fine and I get the updates if the content of the doc changes on the server side.
Where am I going wrong here? Is this even supposed to work like this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions