Skip to content

[QUESTION]why useAllList didn't change when item is changed? #446

Answered by a-type
xmsz-stu asked this question in Q&A
Discussion options

You must be logged in to vote

The query hooks (useX, useOneX, useAllX) are only meant to update when documents are added or removed from the query itself. They will not trigger a re-render if the contents of those documents change. To watch for changes to document contents, use hooks.useWatch(doc), passing the document you want to monitor. If you want to watch for any deep changes to a single document, you can also pass { deep: true } as a second parameter, and it will watch for any changes in nested levels of the document, too.

Your question does expose a gap in covered functionality -- there is no way to have a component listen to all changes made to all documents that match a query. However, I haven't personally en…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xmsz-stu
Comment options

Answer selected by xmsz-stu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #445 on December 10, 2024 21:03.