CBLQueryExpression
@interface CBLQueryExpression : NSObject
A CBLQueryExpression represents an expression used for constructing a query statement.
-
Creates a property expression representing the value of the given property name.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)property:(nonnull NSString *)property;
Parameters
property
The property name in the key path format.
Return Value
The property expression.
-
Creates a property expression representing the value of the given property name.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)property:(nonnull NSString *)property from:(nullable NSString *)alias;
Parameters
property
Property name in the key path format.
alias
The data source alias name.
Return Value
The property expression.
-
Gets a CBLQueryMeta object, which is a factory object for creating metadata property expressions.
Declaration
Objective-C
+ (nonnull CBLQueryMeta *)meta;
Return Value
The CBLQueryMeta object.
-
Gets a CBLQueryMeta object for the given data source. The CBLQueryMeta object is a factory object for creating metadata property expressions.
Declaration
Objective-C
+ (nonnull CBLQueryMeta *)metaFrom:(nullable NSString *)alias;
Parameters
alias
The data source alias name.
Return Value
The CBLQueryMeta object.
-
Creates a parameter expression with the given parameter name.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)parameterNamed:(nonnull NSString *)name;
Parameters
name
The parameter name
Return Value
The parameter expression.
-
Creates a collate expression with the given Collation specification. Commonly the collate expression is used in the Order BY clause or the string comparison expression (e.g. equalTo or lessThan) to specify how the two strings are compared.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)collate:(nonnull CBLQueryCollation *)collation;
Parameters
collation
The Collation object.
Return Value
The collate expression.
-
Creates a negated expression representing the negated result of the given expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)negated:(nonnull id)expression;
Parameters
expression
The expression to be negated.
Return Value
The negated expression.
-
Creates a negated expression representing the negated result of the given expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *) not:(nonnull id)expression;
Parameters
expression
The expression to be negated.
Return Value
The negated expression.
-
Creates a concat expression to concatenate the current expression with the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)concat:(nonnull id)expression;
Parameters
expression
The expression to be concatenated with.
Return Value
The concat expression.
-
Creates a multiply expression to multiply the current expression by the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)multiply:(nonnull id)expression;
Parameters
expression
The expression to be multipled by.
Return Value
The multiply expression.
-
Creates a divide expression to divide the current expression by the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)divide:(nonnull id)expression;
Parameters
expression
The expression to be devided by.
Return Value
The divide expression.
-
Creates a modulo expression to modulo the current expression by the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)modulo:(nonnull id)expression;
Parameters
expression
The expression to be moduloed by.
Return Value
The modulo expression.
-
Creates an add expression to add the given expression to the current expression .
Declaration
Objective-C
- (nonnull CBLQueryExpression *)add:(nonnull id)expression;
Parameters
expression
The expression to add to the current expression.
Return Value
The add expression.
-
Creates a subtract expression to subtract the given expression from the current expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)subtract:(nonnull id)expression;
Parameters
expression
The expression to substract from the current expression.
Return Value
The subtract expression.
-
Creates a less than expression that evaluates whether or not the current expression is less than the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)lessThan:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The less than expression.
-
Creates a NOT less than expression that evaluates whether or not the current expression is not less than the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notLessThan:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The NOT less than expression.
-
Creates a less than or equal to expression that evaluates whether or not the current expression is less than or equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)lessThanOrEqualTo:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The less than or equal to expression.
-
Creates a NOT less than or equal to expression that evaluates whether or not the current expression is not less than or equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notLessThanOrEqualTo:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The NOT less than or equal to expression.
-
Creates a greater than expression that evaluates whether or not the current expression is greater than the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)greaterThan:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The greater than expression.
-
Creates a NOT greater than expression that evaluates whether or not the current expression is not greater than the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notGreaterThan:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The NOT greater than expression.
-
Creates a greater than or equal to expression that evaluates whether or not the current expression is greater than or equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)greaterThanOrEqualTo:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The greater than or equal to expression.
-
Creates a NOT greater than or equal to expression that evaluates whether or not the current expression is not greater than or equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notGreaterThanOrEqualTo:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The NOT greater than or equal to expression.
-
Creates an equal to expression that evaluates whether or not the current expression is equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)equalTo:(nullable id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The equal to expression.
-
Creates a NOT equal to expression that evaluates whether or not the current expression is not equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notEqualTo:(nullable id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The NOT equal to expression.
-
Creates a logical AND expression that performs logical AND operation with the current expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)andExpression:(nonnull id)expression;
Parameters
expression
The expression to AND with the current expression.
Return Value
The logical AND expression.
-
Creates a logical OR expression that performs logical OR operation with the current expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)orExpression:(nonnull id)expression;
Parameters
expression
The expression to OR with the current expression.
Return Value
The logical OR Expression.
-
Creates a Like expression that evaluates whether or not the current expression is LIKE the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)like:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The Like expression.
-
Creates a NOT Like expression that evaluates whether or not the current expression is NOT LIKE the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notLike:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The NOT Like expression.
-
Creates a regex match expression that evaluates whether or not the current expression regex matches the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)regex:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The regex match expression.
-
Creates a regex NOT match expression that evaluates whether or not the current expression regex NOT matches the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notRegex:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The regex NOT match expression.
-
Creates a full text match expression that evaluates whether or not the current expression full text matches the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)match:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The full text match expression.
-
Creates a full text NOT match expression that evaluates whether or not the current expression full text NOT matches the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notMatch:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The full text NOT match expression.
-
Creates an IS NULL OR MISSING expression that evaluates whether or not the current expression is null or missing.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)isNullOrMissing;
Return Value
The IS NULL OR MISSING expression.
-
Creates an IS NOT NULL OR MISSING expression that evaluates whether or not the current expression is NOT null or missing.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notNullOrMissing;
Return Value
The IS NOT NULL OR MISSING expression.
-
Creates an IS expression that evaluates whether or not the current expression is equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)is:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The IS expression.
-
Creates an IS NOT expression that evaluates whether or not the current expression is not equal to the given expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)isNot:(nonnull id)expression;
Parameters
expression
The expression to be compared with the current expression.
Return Value
The IS NOT expression.
-
Creates a between expression that evaluates whether or not the current expression is between the given expressions inclusively.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)between:(nonnull id)expression1 and:(nonnull id)expression2;
Parameters
expression1
The inclusive lower bound expression.
expression2
The inclusive upper bound expression.
Return Value
The between expression.
-
Creates a NOT between expression that evaluates whether or not the current expression is not between the given expressions inclusively.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notBetween:(nonnull id)expression1 and:(nonnull id)expression2;
Parameters
expression1
The inclusive lower bound expression.
expression2
The inclusive upper bound expression.
Return Value
The NOT between expression.
-
Creates an IN expression that evaluates whether or not the current expression is in the given expressions.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)in:(nonnull NSArray *)expressions;
Parameters
expressions
The expression array to be evaluated with.
Return Value
The IN exprssion.
-
Creates a NOT IN expression that evaluates whether or not the current expression is not in the given expressions.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)notIn:(nonnull NSArray *)expressions;
Parameters
expressions
The expression array to be evaluated with.
Return Value
The IN exprssion.
-
Creates a variable expression. The variable are used to represent each item in an array in the quantified operators (ANY/ANY AND EVERY/EVERY
IN SATISFIES ) to evaluate expressions over an array. Declaration
Objective-C
+ (nonnull CBLQueryExpression *)variableNamed:(nonnull NSString *)name;
Parameters
name
The variable name.
Return Value
The variable expression.
-
Creates an ANY quantified operator (ANY
IN SATISFIES ) to evaluate expressions over an array. The ANY operator returns TRUE if at least one of the items in the array satisfies the given satisfies expression. Declaration
Objective-C
+ (nonnull CBLQueryExpression *)any:(nonnull NSString *)variableName in:(nonnull id)inExpression satisfies:(nonnull CBLQueryExpression *)satisfies;
Parameters
variableName
The variable name represent to an item in the array.
inExpression
The array expression that can be evaluated as an array.
satisfies
The expression to be evaluated with.
Return Value
The ANY quantifies operator.
-
Creates an ANY AND EVERY quantified operator (ANY AND EVERY
IN SATISFIES ) to evaluate expressions over an array. The ANY AND EVERY operator returns TRUE if the array is NOT empty, and at least one of the items in the array satisfies the given satisfies expression. Declaration
Objective-C
+ (nonnull CBLQueryExpression *)anyAndEvery:(nonnull NSString *)variableName in:(nonnull id)inExpression satisfies: (nonnull CBLQueryExpression *)satisfies;
Parameters
variableName
The variable name represent to an item in the array.
inExpression
The array expression that can be evaluated as an array.
satisfies
The expression to be evaluated with.
Return Value
The ANY AND EVERY quantifies operator.
-
Creates an EVERY quantified operator (ANY
IN SATISFIES ) to evaluate expressions over an array. The EVERY operator returns TRUE if the array is empty OR every item in the array satisfies the given satisfies expression. Declaration
Objective-C
+ (nonnull CBLQueryExpression *)every:(nonnull NSString *)variableName in:(nonnull id)inExpression satisfies:(nonnull CBLQueryExpression *)satisfies;
Parameters
variableName
The variable name represent to an item in the array.
inExpression
The array expression that can be evaluated as an array.
satisfies
The expression to be evaluated with.
Return Value
The EVERY quantifies operator.
-
Not available.
Declaration
Objective-C
- (nonnull instancetype)init;