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;
Swift
class func property(_ property: String) -> CBLQueryExpression
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;
Swift
class func property(_ property: String, from alias: String?) -> CBLQueryExpression
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;
Swift
class func all() -> CBLQueryExpression
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;
Swift
class func all(from alias: String?) -> CBLQueryExpression
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 and null.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)value:(nullable id)value;
Swift
class func value(_ value: Any?) -> CBLQueryExpression
Parameters
value
The value.
Return Value
The value expression.
-
Creates a string expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)string:(nullable NSString *)value;
Swift
class func string(_ value: String?) -> CBLQueryExpression
Parameters
value
The string value.
Return Value
The string expression.
-
Creates a number expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)number:(nullable NSNumber *)value;
Swift
class func number(_ value: NSNumber?) -> CBLQueryExpression
Parameters
value
The number value.
Return Value
The number expression.
-
Creates an integer expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)integer:(NSInteger)value;
Swift
class func integer(_ value: Int) -> CBLQueryExpression
Parameters
value
The integer value.
Return Value
The integer expression.
-
Creates a long long expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)longLong:(long long)value;
Swift
class func longLong(_ value: Int64) -> CBLQueryExpression
Parameters
value
The long long value.
Return Value
The long long expression.
-
Creates a float expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *) float:(float)value;
Swift
class func float(_ value: Float) -> CBLQueryExpression
Parameters
value
The float value.
Return Value
The float expression.
-
Creates a double expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *) double:(double)value;
Swift
class func double(_ value: Double) -> CBLQueryExpression
Parameters
value
The double value.
Return Value
The double expression.
-
Creates a boolean expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)boolean:(BOOL)value;
Swift
class func boolean(_ value: Bool) -> CBLQueryExpression
Parameters
value
The boolean value.
Return Value
The boolean expression.
-
Creates a date expression.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)date:(nullable NSDate *)value;
Swift
class func date(_ value: Date?) -> CBLQueryExpression
Parameters
value
The date value.
Return Value
The date expression.
-
Creates a parameter expression with the given parameter name.
Declaration
Objective-C
+ (nonnull CBLQueryExpression *)parameterNamed:(nonnull NSString *)name;
Swift
class func parameterNamed(_ name: String) -> CBLQueryExpression
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;
Swift
class func negated(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
class func not(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func multiply(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func divide(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func modulo(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func add(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func subtract(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func lessThan(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func lessThanOrEqual(to expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func greaterThan(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func greaterThanOrEqual(to expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func equal(to expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func notEqual(to expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func like(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func regex(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func `is`(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func isNot(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func isNullOrMissing() -> CBLQueryExpression
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;
Swift
func notNullOrMissing() -> CBLQueryExpression
Return Value
The IS NOT NULL OR MISSING expression.
-
Creates a logical AND expression that performs logical AND operation with the current expression.
Declaration
Objective-C
- (nonnull CBLQueryExpression *)andExpression: (nonnull CBLQueryExpression *)expression;
Swift
func andExpression(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func orExpression(_ expression: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func between(_ expression1: CBLQueryExpression, and expression2: CBLQueryExpression) -> CBLQueryExpression
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;
Swift
func `in`(_ expressions: [CBLQueryExpression]) -> CBLQueryExpression
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;
Swift
func collate(_ collation: CBLQueryCollation) -> CBLQueryExpression
Parameters
collation
The Collation object.
Return Value
The collate expression.
-
Not available.
Declaration
Objective-C
- (nonnull instancetype)init;