Declared in NSManagedObject+MagicalAggregation.h

Class Methods

MR_aggregateOperation:onAttribute:withPredicate:

+ (id)MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate

MR_aggregateOperation:onAttribute:withPredicate:groupBy:

+ (NSArray *)MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString *)groupingKeyPath
Discussion

Supports aggregating values using a key-value collection operator that can be grouped by an attribute. See https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html for a list of valid collection operators.

This method is run against the default MagicalRecordStack’s context.

Parameters

collectionOperator

Collection operator

attributeName

Entity attribute to apply the collection operator to

predicate

Predicate to filter results

groupingKeyPath

Key path to group results by

Return Value

Results of the collection operator, filtered by the provided predicate and grouped by the provided key path

Availability

2.3.0

Declared In

NSManagedObject+MagicalAggregation.h

MR_aggregateOperation:onAttribute:withPredicate:groupBy:inContext:

+ (NSArray *)MR_aggregateOperation:(NSString *)collectionOperator onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate groupBy:(NSString *)groupingKeyPath inContext:(NSManagedObjectContext *)context
Discussion

Supports aggregating values using a key-value collection operator that can be grouped by an attribute. See https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html for a list of valid collection operators.

Parameters

collectionOperator

Collection operator

attributeName

Entity attribute to apply the collection operator to

predicate

Predicate to filter results

groupingKeyPath

Key path to group results by

context

Context to perform the request in

Return Value

Results of the collection operator, filtered by the provided predicate and grouped by the provided key path

Availability

2.3.0

Declared In

NSManagedObject+MagicalAggregation.h

MR_aggregateOperation:onAttribute:withPredicate:inContext:

+ (id)MR_aggregateOperation:(NSString *)function onAttribute:(NSString *)attributeName withPredicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)context

MR_countOfEntities

+ (NSUInteger)MR_countOfEntities

MR_countOfEntitiesWithContext:

+ (NSUInteger)MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context

MR_countOfEntitiesWithPredicate:

+ (NSUInteger)MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter

MR_countOfEntitiesWithPredicate:inContext:

+ (NSUInteger)MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter inContext:(NSManagedObjectContext *)context

MR_hasAtLeastOneEntity

+ (BOOL)MR_hasAtLeastOneEntity

MR_hasAtLeastOneEntityInContext:

+ (BOOL)MR_hasAtLeastOneEntityInContext:(NSManagedObjectContext *)context

MR_numberOfEntities

+ (NSNumber *)MR_numberOfEntities

MR_numberOfEntitiesWithContext:

+ (NSNumber *)MR_numberOfEntitiesWithContext:(NSManagedObjectContext *)context

MR_numberOfEntitiesWithPredicate:

+ (NSNumber *)MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm

MR_numberOfEntitiesWithPredicate:inContext:

+ (NSNumber *)MR_numberOfEntitiesWithPredicate:(NSPredicate *)searchTerm inContext:(NSManagedObjectContext *)context

Instance Methods

MR_maxValueFor:

- (id)MR_maxValueFor:(NSString *)property

MR_minValueFor:

- (id)MR_minValueFor:(NSString *)property

MR_objectWithMinValueFor:

- (instancetype)MR_objectWithMinValueFor:(NSString *)property

MR_objectWithMinValueFor:inContext:

- (instancetype)MR_objectWithMinValueFor:(NSString *)property inContext:(NSManagedObjectContext *)context