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) -> CBLQueryExpressionParameters
propertyThe 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?) -> CBLQueryExpressionParameters
propertyProperty name in the key path format.
aliasThe 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() -> CBLQueryExpressionReturn 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?) -> CBLQueryExpressionParameters
aliasThe 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?) -> CBLQueryExpressionParameters
valueThe 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?) -> CBLQueryExpressionParameters
valueThe 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?) -> CBLQueryExpressionParameters
valueThe 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) -> CBLQueryExpressionParameters
valueThe 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) -> CBLQueryExpressionParameters
valueThe 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) -> CBLQueryExpressionParameters
valueThe 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) -> CBLQueryExpressionParameters
valueThe 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) -> CBLQueryExpressionParameters
valueThe 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?) -> CBLQueryExpressionParameters
valueThe 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) -> CBLQueryExpressionParameters
nameThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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() -> CBLQueryExpressionReturn 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() -> CBLQueryExpressionReturn 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expressionThe 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) -> CBLQueryExpressionParameters
expression1The inclusive lower bound expression.
expression2The 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]) -> CBLQueryExpressionParameters
expressionsThe 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) -> CBLQueryExpressionParameters
collationThe Collation object.
Return Value
The collate expression.
-
Not available.
Declaration
Objective-C
- (nonnull instancetype)init;
CBLQueryExpression Class Reference