Inherits from NSObject
Declared in KiiQuery.h

Overview

A class to handle queries against the data store.

This class gives an application the opportunity to query the server for a refined set of results. A query must be initialized with a collection (class) to query against, can be composed of various attributes, and must contain a KiiClause for its main definition.

Properties

limit

The maximum number of items to be returned This limit behaves in a best effort way. Actual number of the items in the response could be smaller than the limit. (But never exceeds.) If the specified limit is greater than the limit of the server or limit is 0, limit of the server will be applied.

@property (nonatomic, assign) unsigned int limit

Discussion

The maximum number of items to be returned This limit behaves in a best effort way. Actual number of the items in the response could be smaller than the limit. (But never exceeds.) If the specified limit is greater than the limit of the server or limit is 0, limit of the server will be applied.

Declared In

KiiQuery.h

sortDescending

TRUE if the result set should be sorted in descending order

@property (readonly) BOOL sortDescending

Discussion

TRUE if the result set should be sorted in descending order

Declared In

KiiQuery.h

sortField

The file container being queried. nil if querying for objects.

@property (readonly, nullable) NSString *sortField

Discussion

The file container being queried. nil if querying for objects.

Declared In

KiiQuery.h

Class Methods

queryWithClause:

Create a KiiQuery object based on a KiiClause

+ (KiiQuery *)queryWithClause:(nullable KiiClause *)clause

Parameters

clause

The KiiClause to be executed with the query

Discussion

Create a KiiQuery object based on a KiiClause

By passing nil as the ‘clause’ parameter, all objects can be retrieved.

Declared In

KiiQuery.h

queryWithDictionary:

Create KiiQuery from Dictionary

+ (KiiQuery *)queryWithDictionary:(nullable NSDictionary *)queryDict

Parameters

queryDict

Dictionary represents query. Should be equivalent to JSON object constructed for query REST api.

Return Value

KiiQuery instance

Discussion

Create KiiQuery from Dictionary

You may not use this method.

This is introduced for internal use.

Declared In

KiiQuery.h

Instance Methods

sortByAsc:

Set the query to sort by a field in ascending order

- (void)sortByAsc:(NSString *)field

Parameters

field

The key that should be used to sort

Discussion

Set the query to sort by a field in ascending order

If a sort has already been set, it will be overwritten.

Declared In

KiiQuery.h

sortByDesc:

Set the query to sort by a field in descending order

- (void)sortByDesc:(NSString *)field

Parameters

field

The key that should be used to sort

Discussion

Set the query to sort by a field in descending order

If a sort has already been set, it will be overwritten.

Declared In

KiiQuery.h