realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

Add support for keypath filtering

Open cmelchior opened this issue 3 years ago • 1 comments

From Realm Java we had this issue: https://github.com/realm/realm-java/issues/4786

Which is about object level notifications only triggering if top-level properties are modified, but not if nested objects are modified. For RealmResults this also works for nested objects.

This is a highly surprising behavior and something we should fix: https://github.com/realm/realm-core/issues/5212

One work-around is adding support for keypath filtering, which also has other use cases where you want to filter notifications.

We should add support for this to our query API.

A suggested API could be something like:

RealmQuery.asFlow(keyPaths: Array<String>)
RealmSingleQuery.asFlow(keyPaths: Array<String>)

We need Core support before this can happen: https://github.com/realm/realm-core/issues/5216

I don't believe Core currently has support for wildcards, e.g * or myList.*, which would probably also be helpful, but we should push for that in Core instead.

cmelchior avatar Feb 02 '22 09:02 cmelchior

This has now been merged in Core.

cmelchior avatar Apr 06 '22 09:04 cmelchior