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.

  • Creates a * expression to express all properties.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)all;

    Return Value

    The star expression.

  • Creates a * expression to express all properties of the given datasource.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)allFrom:(nullable NSString *)alias;

    Parameters

    alias

    The data source alias name.

    Return Value

    The star expression.

  • Creates a value expresion. The supported value types are NSString, NSNumber, NSInteger, long long, float, double, boolean, NSDate, NSDictionary, NSArray, and null.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)value:(nullable id)value;

    Parameters

    value

    The value.

    Return Value

    The value expression.

  • Creates a string expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)string:(nullable NSString *)value;

    Parameters

    value

    The string value.

    Return Value

    The string expression.

  • Creates a number expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)number:(nullable NSNumber *)value;

    Parameters

    value

    The number value.

    Return Value

    The number expression.

  • Creates an integer expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)integer:(NSInteger)value;

    Parameters

    value

    The integer value.

    Return Value

    The integer expression.

  • Creates a long long expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)longLong:(long long)value;

    Parameters

    value

    The long long value.

    Return Value

    The long long expression.

  • Creates a float expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)float:(float)value;

    Parameters

    value

    The float value.

    Return Value

    The float expression.

  • Creates a double expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)double:(double)value;

    Parameters

    value

    The double value.

    Return Value

    The double expression.

  • Creates a boolean expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)boolean:(BOOL)value;

    Parameters

    value

    The boolean value.

    Return Value

    The boolean expression.

  • Creates a date expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)date:(nullable NSDate *)value;

    Parameters

    value

    The date value.

    Return Value

    The date expression.

  • Creates a dictionary expression. The supported value types are NSString, NSNumber, NSInteger, long long, float, double, boolean, NSDate, NSDictionary, NSArray, null, and CBLQueryExpression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)dictionary:(nullable NSDictionary *)value;

    Parameters

    value

    The dictionary value.

    Return Value

    The dictionary expression.

  • Creates an array expression. The supported value types are NSString, NSNumber, NSInteger, long long, float, double, boolean, NSDate, NSDictionary, NSArray, null, and CBLQueryExpression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)array:(nullable NSArray *)value;

    Parameters

    value

    The array value.

    Return Value

    The array expression

  • 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 negated expression representing the negated result of the given expression.

    Declaration

    Objective-C

    + (nonnull CBLQueryExpression *)negated:
        (nonnull CBLQueryExpression *)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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be negated.

    Return Value

    The negated expression.

  • Creates a multiply expression to multiply the current expression by the given expression.

    Declaration

    Objective-C

    - (nonnull CBLQueryExpression *)multiply:
        (nonnull CBLQueryExpression *)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 CBLQueryExpression *)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 CBLQueryExpression *)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 CBLQueryExpression *)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 CBLQueryExpression *)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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The 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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The 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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The 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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The 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:
        (nonnull CBLQueryExpression *)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:
        (nonnull CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The NOT equal to 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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The 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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The regex match 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 CBLQueryExpression *)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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to be compared with the current expression.

    Return Value

    The IS NOT 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 VALUED expression that evaluates whether or not the current expression is NOT null or missing.

    Declaration

    Objective-C

    - (nonnull CBLQueryExpression *)isValued;

    Return Value

    The IS VALUED expression.

  • Creates an IS NOT VALUED expression that evaluates whether or not the current expression is null or missing.

    Declaration

    Objective-C

    - (nonnull CBLQueryExpression *)isNotValued;

    Return Value

    The IS NOT VALUED expression.

  • Creates a logical AND expression that performs logical AND operation with the current expression.

    Declaration

    Objective-C

    - (nonnull CBLQueryExpression *)andExpression:
        (nonnull CBLQueryExpression *)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 CBLQueryExpression *)expression;

    Parameters

    expression

    The expression to OR with the current expression.

    Return Value

    The logical OR 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 CBLQueryExpression *)expression1
            and:(nonnull CBLQueryExpression *)expression2;

    Parameters

    expression1

    The inclusive lower bound expression.

    expression2

    The inclusive upper bound expression.

    Return Value

    The 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<CBLQueryExpression *> *)expressions;

    Parameters

    expressions

    The expression array to be evaluated with.

    Return Value

    The IN exprssion.

  • 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.

  • Not available.

    Declaration

    Objective-C

    - (nonnull instancetype)init;