-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
3 - M (<= 1 month)
-
2780
This is what my models look like.
@interface FeedItem : RLMObject @property NSString *title; @property BOOL isUnread; @end RLM_ARRAY_TYPE(FeedItem) @interface Feed : RLMObject @property NSString *title; @property RLMArray<FeedItem *><FeedItem> *items; @end
Now, say I want display to a user, an auto-updating list of only those feeds that have (1 or more) unread items, in a UITableView.
Ideally, I would fetch it like this:
RLMResults *unreadFeeds = [Feed objectsWithPredicate:[NSPredicate predicateWithFormat: @"items.@sum.isUnread < 0"]];
But, with the above query, Realm throws an exception with the reason: '@sum can only be applied to a numeric property.'
Any chance, we can get support for this operator on BOOL properties?
I have several other use cases for sumOfProperty: to also be allowed on BOOL properties, and in general all 'Aggregating Property Values' methods to be made available on RLMArray.