Closed RWOverdijk closed 4 years ago
I'm not sure I fully understand what your asking here..
But I do think the concept of reactive paths & queries
might be useful here. It allows you to create a document or collection and have the path or query update, depending on the content of another document.
const doc = new Document('bar/mybar');
const col = new Collection('foos', {
query: ref => ref.where('bar', '==', doc.data.bar)
});
It was silly. I solved it with a new doc and it does listen for changes.
I have a list of products, and I have product details. When I go to the product details I'd like to fetch only that specific product. I know I can use
Document
to fetch a single document, but I need a query. And I also need to have listeners.So: how can I fetch a single document by query, and have it updated when it changes in firestore?
Update: I figured out I can use query to fetch a document, and then use that ID to create a new Document with mode set to 'on' or 'auto'.
But that doesn't seem to update the document when changes are made in the firebase console