realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.34k stars 2.15k forks source link

Backlink queries using @links #8712

Open BlueCobold opened 1 week ago

BlueCobold commented 1 week ago

Problem

According to the Realm Query Language documentation (https://www.mongodb.com/docs/atlas/device-sdks/realm-query-language/#backlink-queries), it should be possible to include backlink query aggregate operators in Realm-Swift queries. However, this works in RealmKotlin, but not in RealmSwift.

Solution

realm.objects(T.self).filter("@links.@count == 0")
realm.objects(T.self).filter("@links.@count > 1")
realm.objects(T.self).filter("ANY @links.Project.items.quota > 0")

Alternatives

No response

How important is this improvement for you?

Would be a major improvement

Feature would mainly be used with

Local Database only

sync-by-unito[bot] commented 1 week ago

➤ PM Bot commented:

Jira ticket: RCOCOA-2456