CBLQueryFunction

@interface CBLQueryFunction : CBLQueryExpression

CBLQueryFunction represents a function expression.

  • Creates an AVG(expr) function expression that returns the average of all the number values in the group of the values expressed by the given expression.

    Declaration

    Objective-C

    + (nonnull instancetype)avg:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The AVG(expr) function.

  • Creates a COUNT(expr) function expression that returns the count of all values in the group of the values expressed by the given expression.

    Declaration

    Objective-C

    + (nonnull instancetype)count:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The COUNT(expr) function.

  • Creates a MIN(expr) function expression that returns the minimum value in the group of the values expressed by the given expression.

    Declaration

    Objective-C

    + (nonnull instancetype)min:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The MIN(expr) function.

  • Creates a MAX(expr) function expression that returns the maximum value in the group of the values expressed by the given expression.

    Declaration

    Objective-C

    + (nonnull instancetype)max:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The MAX(expr) function.

  • Creates a SUM(expr) function expression that return the sum of all number values in the group of the values expressed by the given expression.

    Declaration

    Objective-C

    + (nonnull instancetype)sum:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The SUM(expr) function.

  • Creates an ARRAY_CONTAINS(expr, value) function that checks whether the given array expression contains the given value or not.

    Declaration

    Objective-C

    + (nonnull instancetype)arrayContains:(nonnull id)expression
                                    value:(nullable id)value;

    Parameters

    expression

    The expression that evluates to an array.

    value

    The value to search for in the given array expression.

    Return Value

    The ARRAY_CONTAINS(expr, value) function.

  • Creates an ARRAY_LENGTH(expr) function that returns the length of the given array expression.

    Declaration

    Objective-C

    + (nonnull instancetype)arrayLength:(nonnull id)expression;

    Parameters

    expression

    The expression that evluates to an array.

    Return Value

    The ARRAY_LENGTH(expr) function.

  • Creates an ABS(expr) function that returns the absolute value of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)abs:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The ABS(expr) function.

  • Creates an ACOS(expr) function that returns the inverse cosine of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)acos:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The ACOS(expr) function.

  • Creates an ASIN(expr) function that returns the inverse sin of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)asin:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The ASIN(expr) function.

  • Creates an ATAN(expr) function that returns the inverse tangent of the numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)atan:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The ATAN(expr) function.

  • Creates an ATAN2(X, Y) function that returns the arctangent of y/x.

    Declaration

    Objective-C

    + (nonnull instancetype)atan2:(nonnull id)x y:(nonnull id)y;

    Parameters

    x

    The expression to evaluate as the X coordinate.

    y

    The expression to evaluate as the Y coordinate.

    Return Value

    The ATAN2(X, Y) function.

  • Creates a CEIL(expr) function that returns the ceiling value of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)ceil:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The CEIL(expr) function.

  • Creates a COS(expr) function that returns the cosine of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)cos:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The COS(expr) function.

  • Creates a DEGREES(expr) function that returns the degrees value of the given radiants value expression.

    Declaration

    Objective-C

    + (nonnull instancetype)degrees:(nonnull id)expression;

    Parameters

    expression

    The numeric expression to evaluate as a radiants value.

    Return Value

    The DEGREES(expr) function.

  • +e

    Creates a E() function that return the value of the mathemetical constant ‘e’.

    Declaration

    Objective-C

    + (nonnull instancetype)e;

    Return Value

    The E() constant function.

  • Creates a EXP(expr) function that returns the value of ‘e’ power by the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)exp:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The EXP(expr) function.

  • Creates a FLOOR(expr) function that returns the floor value of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)floor:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The FLOOR(expr) function.

  • Creates a LN(expr) function that returns the natural log of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)ln:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The LN(expr) function.

  • Creates a LOG(expr) function that returns the base 10 log of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)log:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The LOG(expr) function.

  • +pi

    Creates a PI() function that returns the mathemetical constant Pi.

    Declaration

    Objective-C

    + (nonnull instancetype)pi;

    Return Value

    The PI() constant function.

  • Creates a POWER(base, exponent) function that returns the value of the given base expression power the given exponent expression.

    Declaration

    Objective-C

    + (nonnull instancetype)power:(nonnull id)base exponent:(nonnull id)exponent;

    Parameters

    base

    The base expression.

    exponent

    The exponent expression.

    Return Value

    The POWER(base, exponent) function.

  • Creates a RADIANS(expr) function that returns the radians value of the given degrees value expression.

    Declaration

    Objective-C

    + (nonnull instancetype)radians:(nonnull id)expression;

    Parameters

    expression

    The numeric expression to evaluate as a degrees value.

    Return Value

    The RADIANS(expr) function.

  • Creates a ROUND(expr) function that returns the rounded value of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)round:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The ROUND(expr) function.

  • Creates a ROUND(expr, digits) function that returns the rounded value to the given number of digits of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)round:(nonnull id)expression digits:(NSInteger)digits;

    Parameters

    expression

    The numeric expression.

    digits

    The number of digits.

    Return Value

    The ROUND(expr, digits) function.

  • Creates a SIGN(expr) function that returns the sign (1: positive, -1: negative, 0: zero) of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)sign:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The SIGN(expr) function.

  • Creates a SIN(expr) function that returns the sin of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)sin:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The SIN(expr) function.

  • Creates a SQRT(expr) function that returns the square root of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)sqrt:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The SQRT(expr) function.

  • Creates a TAN(expr) function that returns the tangent of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)tan:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The TAN(expr) function.

  • Creates a TRUNC(expr) function that truncates all of the digits after the decimal place of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)trunc:(nonnull id)expression;

    Parameters

    expression

    The numeric expression.

    Return Value

    The trunc function.

  • Creates a TRUNC(expr, digits) function that truncates the number of the digits after the decimal place of the given numeric expression.

    Declaration

    Objective-C

    + (nonnull instancetype)trunc:(nonnull id)expression digits:(NSInteger)digits;

    Parameters

    expression

    The numeric expression.

    digits

    The number of digits to truncate.

    Return Value

    The TRUNC(expr, digits) function.

  • Creates a CONTAINS(expr, substr) function that evaluates whether the given string expression conatins the given substring expression or not.

    Declaration

    Objective-C

    + (nonnull instancetype)contains:(nonnull id)expression
                           substring:(nonnull id)substring;

    Parameters

    expression

    The string expression.

    substring

    The substring expression.

    Return Value

    The CONTAINS(expr, substr) function.

  • Creates a LENGTH(expr) function that returns the length of the given string expression.

    Declaration

    Objective-C

    + (nonnull instancetype)length:(nonnull id)expression;

    Parameters

    expression

    The string expression.

    Return Value

    The LENGTH(expr) function.

  • Creates a LOWER(expr) function that returns the lowercase string of the given string expression.

    Declaration

    Objective-C

    + (nonnull instancetype)lower:(nonnull id)expression;

    Parameters

    expression

    The string expression.

    Return Value

    The LOWER(expr) function.

  • Creates a LTRIM(expr) function that removes the whitespace from the beginning of the given string expression.

    Declaration

    Objective-C

    + (nonnull instancetype)ltrim:(nonnull id)expression;

    Parameters

    expression

    The string expression.

    Return Value

    The LTRIM(expr) function.

  • Creates a RTRIM(expr) function that removes the whitespace from the end of the given string expression.

    Declaration

    Objective-C

    + (nonnull instancetype)rtrim:(nonnull id)expression;

    Parameters

    expression

    The string expression.

    Return Value

    The RTRIM(expr) function.

  • Creates a TRIM(expr) function that removes the whitespace from the beginning and ‘ the end of the given string expression.

    Declaration

    Objective-C

    + (nonnull instancetype)trim:(nonnull id)expression;

    Parameters

    expression

    The string expression.

    Return Value

    The TRIM(expr) function.

  • Creates a UPPER(expr) function that returns the uppercase string of the given string expression.

    Declaration

    Objective-C

    + (nonnull instancetype)upper:(nonnull id)expression;

    Parameters

    expression

    The string expression.

    Return Value

    The UPPER(expr) function.

  • Creates a ISARRAY(expr) function that evaluates whether the given expression is an array value of not.

    Declaration

    Objective-C

    + (nonnull instancetype)isArray:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The ISARRAY(expr) function.

  • Creates a ISNUMBER(expr) function that evaluates whether the given expression is a numeric value of not.

    Declaration

    Objective-C

    + (nonnull instancetype)isNumber:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The ISNUMBER(expr) function.

  • Creates a ISDICTIONARY(expr) function that evaluates whether the given expression is a dictionary of not.

    Declaration

    Objective-C

    + (nonnull instancetype)isDictionary:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The ISDICTIONARY(expr) function.

  • Creates a ISSTRING(expr) function that evaluates whether the given expression is a string of not.

    Declaration

    Objective-C

    + (nonnull instancetype)isString:(nonnull id)expression;

    Parameters

    expression

    The expression.

    Return Value

    The ISSTRING(expr) function.

  • Creates a full-text ranking value function indicating how well the current query result matches the full-text query when performing the match comparison.

    Declaration

    Objective-C

    + (nonnull instancetype)rank:(nonnull CBLQueryExpression *)property;

    Parameters

    property

    The property expression used in the full-text match expression.

    Return Value

    The full-text ranking value.