Partial collection updates
Hi,
I would like to do partial collection updates for a subset of records. For example, I only want to refetch from the server the records with a foreignKeyId of 'xyz' which would subsequently update/insert the corresponding records in the collection. Of the 100 records in the collection, this might only fetch a handful of records.
For example, I want something like
My current query function is like this:
I think I need something like this:
This would then update the records where the id matches.
Does this make sense? I know this is not the correct way but I think it's possible. What is the correct way to do this with tanstack DB?
Any help would be appreciated. Thank you.
JT
I would like to do partial collection updates for a subset of records. For example, I only want to refetch from the server the records with a foreignKeyId of 'xyz' which would subsequently update/insert the corresponding records in the collection. Of the 100 records in the collection, this might only fetch a handful of records.
For example, I want something like
myCollection.utils.refetch({ foreignKeyId: 'xyz' });My current query function is like this:
I think I need something like this:
This would then update the records where the id matches.
Does this make sense? I know this is not the correct way but I think it's possible. What is the correct way to do this with tanstack DB?
Any help would be appreciated. Thank you.
JT