MLIMQuery Class Reference

Inherits from NSObject
Declared in MLIMQuery.h

Creating a Query for a Class

+ query

Creats a new query object.

+ (MLIMQuery *)query

Return Value

A MLIMQuery object.

Declared In

MLIMQuery.h

Paginating Results

  skip

The number of objects to skip before returning any. 0 by default.

@property (nonatomic) int skip

Declared In

MLIMQuery.h

  limit

A limit on the number of objects to return. The default limit is 20, with a maximum of 1000 results being returned at a time.

@property (nonatomic) int limit

Declared In

MLIMQuery.h

Adding Basic Constraints

– whereAttribute:equalTo:

Add a constraint to the query that requires a particular attrName’s value to be equal to the provided value.

- (void)whereAttribute:(NSString *)attrName equalTo:(NSString *)value

Parameters

attrName

The attribute name to be constrained.

value

The value that must be equalled.

Declared In

MLIMQuery.h

Sorting

– orderByAscending:

Sort the results in ascending order with the given key.

- (void)orderByAscending:(NSString *)attrName

Parameters

attrName

The attribute to order by.

Declared In

MLIMQuery.h

– addAscendingOrder:

Also sort in ascending order by the given key. The previous keys provided will precedence over this key.

- (void)addAscendingOrder:(NSString *)attrName

Parameters

attrName

The attribute to order by.

Declared In

MLIMQuery.h

– orderByDescending:

Sort the results in descending order with the given key.

- (void)orderByDescending:(NSString *)attrName

Parameters

attrName

The attribute to order by.

Declared In

MLIMQuery.h

– addDescendingOrder:

Also sort in descending order by the given key. The previous keys provided will precedence over this key.

- (void)addDescendingOrder:(NSString *)attrName

Parameters

attrName

The attribute to order by.

Declared In

MLIMQuery.h

– orderBySortDescriptor:

Sort the results in descending order with the given descriptor.

- (void)orderBySortDescriptor:(NSSortDescriptor *)sortDescriptor

Parameters

sortDescriptor

The NSSortDescriptor to order by.

Declared In

MLIMQuery.h

– orderBySortDescriptors:

Sort the results in descending order with the given descriptors.

- (void)orderBySortDescriptors:(nullable NSArray<NSSortDescriptor*> *)sortDescriptors

Parameters

sortDescriptors

An NSArray of NSSortDescriptor instances to order by.

Declared In

MLIMQuery.h

Find Entities

– findUserWithBlock:

Find users.

- (void)findUserWithBlock:(void ( ^ ) ( NSArray<MLIMUser*> *_Nullable users , NSError *_Nullable error ))block

Parameters

block

A block to return the result.

Declared In

MLIMQuery.h

– findGroupWithBlock:

Find groups.

- (void)findGroupWithBlock:(void ( ^ ) ( NSArray<MLIMGroup*> *_Nullable groups , NSError *_Nullable error ))block

Parameters

block

A block to return the result.

Declared In

MLIMQuery.h

– findRoomWithBlock:

Find rooms.

- (void)findRoomWithBlock:(void ( ^ ) ( NSArray<MLIMRoom*> *_Nullable rooms , NSError *_Nullable error ))block

Parameters

block

A block to return the result.

Declared In

MLIMQuery.h