Expression
public final class Expression
Query expression factory.
-
Creates a property expression representing the value of the given property name.
Declaration
Swift
public static func property(_ property: String) -> PropertyExpressionProtocol
Parameters
property
The property name in the key path format.
Return Value
A property expression.
-
Creates a star expression.
Declaration
Swift
public static func all() -> PropertyExpressionProtocol
Return Value
A star expression.
-
Creates a value expression. The supported value types are String, NSNumber, int, int64, float, double, boolean, Date and null.
Declaration
Swift
public static func value(_ value: Any?) -> ExpressionProtocol
Parameters
value
The value.
Return Value
The value expression.
-
Creates a string expression.
Declaration
Swift
public static func string(_ value: String?) -> ExpressionProtocol
Parameters
value
The string value.
Return Value
The string expression.
-
Creates a number expression.
Declaration
Swift
public static func number(_ value: NSNumber?) -> ExpressionProtocol
Parameters
value
The number value.
Return Value
The number expression.
-
Creates an integer expression.
Declaration
Swift
public static func int(_ value: Int) -> ExpressionProtocol
Parameters
value
The integer value.
Return Value
The integer expression.
-
Creates a 64-bit integer expression.
Declaration
Swift
public static func int64(_ value: Int64) -> ExpressionProtocol
Parameters
value
The 64-bit integer value.
Return Value
The 64-bit integer expression.
-
Creates a float expression.
Declaration
Swift
public static func float(_ value: Float) -> ExpressionProtocol
Parameters
value
The float value.
Return Value
The float expression.
-
Creates a double expression.
Declaration
Swift
public static func double(_ value: Double) -> ExpressionProtocol
Parameters
value
The double value.
Return Value
The double expression.
-
Creates a boolean expression.
Declaration
Swift
public static func boolean(_ value: Bool) -> ExpressionProtocol
Parameters
value
The boolean value.
Return Value
The boolean expression.
-
Creates a date expression.
Declaration
Swift
public static func date(_ value: Date?) -> ExpressionProtocol
Parameters
value
The date value.
Return Value
The date expression.
-
Creates a dictionary expression. The supported value types are String, NSNumber, int, int64, float, double, boolean, Date, null and ExpressionProtocol.
Declaration
Swift
public static func dictionary(_ value: Dictionary<String, Any>?) -> ExpressionProtocol
Parameters
value
The dictionary value.
Return Value
The dictionary expression.
-
Creates an array expression. The supported value types are String, NSNumber, int, int64, float, double, boolean, Date, null and ExpressionProtocol.
Declaration
Swift
public static func array(_ value: Array<Any>?) -> ExpressionProtocol
Parameters
value
The array value.
Return Value
The array expression.
-
Creates a parameter expression with the given parameter name.
Declaration
Swift
public static func parameter(_ name: String) -> ExpressionProtocol
Parameters
name
The parameter name
Return Value
A parameter expression.
-
Creates a negated expression representing the negated result of the given expression.
Declaration
Swift
public static func negated(_ expression: ExpressionProtocol) -> ExpressionProtocol
Parameters
expression
The expression to be negated.
Return Value
A negated expression.
-
Creates a negated expression representing the negated result of the given expression.
If the operand isn’t a boolean type, it gets coerced to a boolean. The number 0 is coerced to false, the number 1 is coerced to
true
, strings are coerced tofalse
(but strings prefixed with a number are coerced totrue
, for example “2willowroad@nationaltrust.org.uk”).Declaration
Swift
public static func not(_ expression: ExpressionProtocol) -> ExpressionProtocol
Parameters
expression
The expression to be negated.
Return Value
A negated expression
-
Create a full-text index expression referencing a full-text index with the given index name.
When there is a need to specify the data source in which the index has been created (e.g. in multi-collection join statement, calls the from(_ alias: String) method from the returned FullTextIndexExpressionProtocol object to specify the data source.
Declaration
Swift
public static func fullTextIndex(_ name: String) -> FullTextIndexExpressionProtocol
Parameters
indexName
The name of the full-text index.
Return Value
The full-text index expression referring to a full text index in the specified data source.