@InterfaceStability.Experimental @InterfaceAudience.Public public class ArrayFunctions extends Object
DSL for N1QL functions in the Array category.
You can use array functions to evaluate arrays, perform computations on elements in an array, and to return a new array based on a transformation.
Constructor and Description |
---|
ArrayFunctions() |
Modifier and Type | Method and Description |
---|---|
static Expression |
arrayAppend(Expression expression,
Expression value)
Returned expression results in new array with value appended.
|
static Expression |
arrayAppend(JsonArray array,
Expression value)
Returned expression results in new array with value appended.
|
static Expression |
arrayAppend(String expression,
Expression value)
Returned expression results in new array with value appended.
|
static Expression |
arrayAvg(Expression expression)
Returned expression results in arithmetic mean (average) of all the non-NULL number values in the array, or NULL if there are no such values.
|
static Expression |
arrayAvg(JsonArray array)
Returned expression results in arithmetic mean (average) of all the non-NULL number values in the array, or NULL if there are no such values.
|
static Expression |
arrayAvg(String expression)
Returned expression results in arithmetic mean (average) of all the non-NULL number values in the array, or NULL if there are no such values.
|
static Expression |
arrayConcat(Expression expression1,
Expression expression2)
Returned expression results in new array with the concatenation of the input arrays.
|
static Expression |
arrayConcat(JsonArray array1,
JsonArray array2)
Returned expression results in new array with the concatenation of the input arrays.
|
static Expression |
arrayConcat(String expression1,
String expression2)
Returned expression results in new array with the concatenation of the input arrays.
|
static Expression |
arrayContains(Expression expression,
Expression value)
Returned expression results in true if the array contains value.
|
static Expression |
arrayContains(JsonArray array,
Expression value)
Returned expression results in true if the array contains value.
|
static Expression |
arrayContains(String expression,
Expression value)
Returned expression results in true if the array contains value.
|
static Expression |
arrayCount(Expression expression)
Returned expression results in count of all the non-NULL values in the array, or zero if there are no such values.
|
static Expression |
arrayCount(JsonArray array)
Returned expression results in count of all the non-NULL values in the array, or zero if there are no such values.
|
static Expression |
arrayCount(String expression)
Returned expression results in count of all the non-NULL values in the array, or zero if there are no such values.
|
static Expression |
arrayDistinct(Expression expression)
Returned expression results in new array with distinct elements of input array.
|
static Expression |
arrayDistinct(JsonArray array)
Returned expression results in new array with distinct elements of input array.
|
static Expression |
arrayDistinct(String expression)
Returned expression results in new array with distinct elements of input array.
|
static Expression |
arrayIfNull(Expression expression)
Returned expression results in the first non-NULL value in the array, or NULL.
|
static Expression |
arrayIfNull(JsonArray array)
Returned expression results in the first non-NULL value in the array, or NULL.
|
static Expression |
arrayIfNull(String expression)
Returned expression results in the first non-NULL value in the array, or NULL.
|
static Expression |
arrayLength(Expression expression)
Returned expression results in the number of elements in the array.
|
static Expression |
arrayLength(JsonArray array)
Returned expression results in the number of elements in the array.
|
static Expression |
arrayLength(String expression)
Returned expression results in the number of elements in the array.
|
static Expression |
arrayMax(Expression expression)
Returned expression results in the largest non-NULL, non-MISSING array element, in N1QL collation order.
|
static Expression |
arrayMax(JsonArray array)
Returned expression results in the largest non-NULL, non-MISSING array element, in N1QL collation order.
|
static Expression |
arrayMax(String expression)
Returned expression results in the largest non-NULL, non-MISSING array element, in N1QL collation order.
|
static Expression |
arrayMin(Expression expression)
Returned expression results in the smallest non-NULL, non-MISSING array element, in N1QL collation order.
|
static Expression |
arrayMin(JsonArray array)
Returned expression results in the smallest non-NULL, non-MISSING array element, in N1QL collation order.
|
static Expression |
arrayMin(String expression)
Returned expression results in the smallest non-NULL, non-MISSING array element, in N1QL collation order.
|
static Expression |
arrayPosition(Expression expression,
Expression value)
Returned expression results in the first position of value within the array, or -1.
|
static Expression |
arrayPosition(JsonArray array,
Expression value)
Returned expression results in the first position of value within the array, or -1.
|
static Expression |
arrayPosition(String expression,
Expression value)
Returned expression results in the first position of value within the array, or -1.
|
static Expression |
arrayPrepend(Expression expression,
Expression value)
Returned expression results in the new array with value pre-pended.
|
static Expression |
arrayPrepend(JsonArray array,
Expression value)
Returned expression results in the new array with value pre-pended.
|
static Expression |
arrayPrepend(String expression,
Expression value)
Returned expression results in the new array with value pre-pended.
|
static Expression |
arrayPut(Expression expression,
Expression value)
Returned expression results in new array with value appended, if value is not already present, otherwise the unmodified input array.
|
static Expression |
arrayPut(JsonArray array,
Expression value)
Returned expression results in new array with value appended, if value is not already present, otherwise the unmodified input array.
|
static Expression |
arrayPut(String expression,
Expression value)
Returned expression results in new array with value appended, if value is not already present, otherwise the unmodified input array.
|
static Expression |
arrayRange(long start,
long end)
Returned expression results in new array of numbers, from start until the largest number less than end.
|
static Expression |
arrayRange(long start,
long end,
long step)
Returned expression results in new array of numbers, from start until the largest number less than end.
|
static Expression |
arrayRemove(Expression expression,
Expression value)
Returned expression results in new array with all occurrences of value removed.
|
static Expression |
arrayRemove(JsonArray array,
Expression value)
Returned expression results in new array with all occurrences of value removed.
|
static Expression |
arrayRemove(String expression,
Expression value)
Returned expression results in new array with all occurrences of value removed.
|
static Expression |
arrayRepeat(boolean value,
long n)
Returned expression results in new array with value repeated n times.
|
static Expression |
arrayRepeat(Expression value,
long n)
Returned expression results in new array with value repeated n times.
|
static Expression |
arrayRepeat(Number value,
long n)
Returned expression results in new array with value repeated n times.
|
static Expression |
arrayRepeat(String value,
long n)
Returned expression results in new array with the string “value” repeated n times.
|
static Expression |
arrayReplace(Expression expression,
Expression value1,
Expression value2)
Returned expression results in new array with all occurrences of value1 replaced by value2.
|
static Expression |
arrayReplace(Expression expression,
Expression value1,
Expression value2,
long n)
Returned expression results in new array with at most n occurrences of value1 replaced with value2.
|
static Expression |
arrayReplace(JsonArray array,
Expression value1,
Expression value2)
Returned expression results in new array with all occurrences of value1 replaced by value2.
|
static Expression |
arrayReplace(JsonArray array,
Expression value1,
Expression value2,
long n)
Returned expression results in new array with at most n occurrences of value1 replaced with value2.
|
static Expression |
arrayReplace(String expression,
Expression value1,
Expression value2)
Returned expression results in new array with all occurrences of value1 replaced by value2.
|
static Expression |
arrayReplace(String expression,
Expression value1,
Expression value2,
long n)
Returned expression results in new array with at most n occurrences of value1 replaced with value2.
|
static Expression |
arrayReverse(Expression expression)
Returned expression results in new array with all elements in reverse order.
|
static Expression |
arrayReverse(JsonArray array)
Returned expression results in new array with all elements in reverse order.
|
static Expression |
arrayReverse(String expression)
Returned expression results in new array with all elements in reverse order.
|
static Expression |
arraySort(Expression expression)
Returned expression results in new array with elements sorted in N1QL collation order.
|
static Expression |
arraySort(JsonArray array)
Returned expression results in new array with elements sorted in N1QL collation order.
|
static Expression |
arraySort(String expression)
Returned expression results in new array with elements sorted in N1QL collation order.
|
static Expression |
arraySum(Expression expression)
Returned expression results in the sum of all the non-NULL number values in the array, or zero if there are no such values.
|
static Expression |
arraySum(JsonArray array)
Returned expression results in the sum of all the non-NULL number values in the array, or zero if there are no such values.
|
static Expression |
arraySum(String expression)
Returned expression results in the sum of all the non-NULL number values in the array, or zero if there are no such values.
|
public static Expression arrayAppend(Expression expression, Expression value)
Returned expression results in new array with value appended.
public static Expression arrayAppend(String expression, Expression value)
Returned expression results in new array with value appended.
public static Expression arrayAppend(JsonArray array, Expression value)
Returned expression results in new array with value appended.
public static Expression arrayAvg(Expression expression)
Returned expression results in arithmetic mean (average) of all the non-NULL number values in the array, or NULL if there are no such values.
public static Expression arrayAvg(String expression)
Returned expression results in arithmetic mean (average) of all the non-NULL number values in the array, or NULL if there are no such values.
public static Expression arrayAvg(JsonArray array)
Returned expression results in arithmetic mean (average) of all the non-NULL number values in the array, or NULL if there are no such values.
public static Expression arrayConcat(Expression expression1, Expression expression2)
Returned expression results in new array with the concatenation of the input arrays.
public static Expression arrayConcat(String expression1, String expression2)
Returned expression results in new array with the concatenation of the input arrays.
public static Expression arrayConcat(JsonArray array1, JsonArray array2)
Returned expression results in new array with the concatenation of the input arrays.
public static Expression arrayContains(Expression expression, Expression value)
Returned expression results in true if the array contains value.
public static Expression arrayContains(String expression, Expression value)
Returned expression results in true if the array contains value.
public static Expression arrayContains(JsonArray array, Expression value)
Returned expression results in true if the array contains value.
public static Expression arrayCount(Expression expression)
Returned expression results in count of all the non-NULL values in the array, or zero if there are no such values.
public static Expression arrayCount(String expression)
Returned expression results in count of all the non-NULL values in the array, or zero if there are no such values.
public static Expression arrayCount(JsonArray array)
Returned expression results in count of all the non-NULL values in the array, or zero if there are no such values.
public static Expression arrayDistinct(Expression expression)
Returned expression results in new array with distinct elements of input array.
public static Expression arrayDistinct(String expression)
Returned expression results in new array with distinct elements of input array.
public static Expression arrayDistinct(JsonArray array)
Returned expression results in new array with distinct elements of input array.
public static Expression arrayIfNull(Expression expression)
Returned expression results in the first non-NULL value in the array, or NULL.
public static Expression arrayIfNull(String expression)
Returned expression results in the first non-NULL value in the array, or NULL.
public static Expression arrayIfNull(JsonArray array)
Returned expression results in the first non-NULL value in the array, or NULL.
public static Expression arrayLength(Expression expression)
Returned expression results in the number of elements in the array.
public static Expression arrayLength(String expression)
Returned expression results in the number of elements in the array.
public static Expression arrayLength(JsonArray array)
Returned expression results in the number of elements in the array.
public static Expression arrayMax(Expression expression)
Returned expression results in the largest non-NULL, non-MISSING array element, in N1QL collation order.
public static Expression arrayMax(String expression)
Returned expression results in the largest non-NULL, non-MISSING array element, in N1QL collation order.
public static Expression arrayMax(JsonArray array)
Returned expression results in the largest non-NULL, non-MISSING array element, in N1QL collation order.
public static Expression arrayMin(Expression expression)
Returned expression results in the smallest non-NULL, non-MISSING array element, in N1QL collation order.
public static Expression arrayMin(String expression)
Returned expression results in the smallest non-NULL, non-MISSING array element, in N1QL collation order.
public static Expression arrayMin(JsonArray array)
Returned expression results in the smallest non-NULL, non-MISSING array element, in N1QL collation order.
public static Expression arrayPosition(Expression expression, Expression value)
Returned expression results in the first position of value within the array, or -1. Array position is zero-based, i.e. the first position is 0.
public static Expression arrayPosition(String expression, Expression value)
Returned expression results in the first position of value within the array, or -1. Array position is zero-based, i.e. the first position is 0.
public static Expression arrayPosition(JsonArray array, Expression value)
Returned expression results in the first position of value within the array, or -1. Array position is zero-based, i.e. the first position is 0.
public static Expression arrayPrepend(Expression expression, Expression value)
Returned expression results in the new array with value pre-pended.
public static Expression arrayPrepend(String expression, Expression value)
Returned expression results in the new array with value pre-pended.
public static Expression arrayPrepend(JsonArray array, Expression value)
Returned expression results in the new array with value pre-pended.
public static Expression arrayPut(Expression expression, Expression value)
Returned expression results in new array with value appended, if value is not already present, otherwise the unmodified input array.
public static Expression arrayPut(String expression, Expression value)
Returned expression results in new array with value appended, if value is not already present, otherwise the unmodified input array.
public static Expression arrayPut(JsonArray array, Expression value)
Returned expression results in new array with value appended, if value is not already present, otherwise the unmodified input array.
public static Expression arrayRange(long start, long end, long step)
Returned expression results in new array of numbers, from start until the largest number less than end. Successive numbers are incremented by step. If step is omitted, the default is 1. If step is negative, decrements until the smallest number greater than end.
public static Expression arrayRange(long start, long end)
Returned expression results in new array of numbers, from start until the largest number less than end. Successive numbers are incremented by 1.
public static Expression arrayRemove(Expression expression, Expression value)
Returned expression results in new array with all occurrences of value removed.
public static Expression arrayRemove(String expression, Expression value)
Returned expression results in new array with all occurrences of value removed.
public static Expression arrayRemove(JsonArray array, Expression value)
Returned expression results in new array with all occurrences of value removed.
public static Expression arrayRepeat(Expression value, long n)
Returned expression results in new array with value repeated n times.
public static Expression arrayRepeat(String value, long n)
Returned expression results in new array with the string “value” repeated n times.
public static Expression arrayRepeat(Number value, long n)
Returned expression results in new array with value repeated n times.
public static Expression arrayRepeat(boolean value, long n)
Returned expression results in new array with value repeated n times.
public static Expression arrayReplace(Expression expression, Expression value1, Expression value2)
Returned expression results in new array with all occurrences of value1 replaced by value2.
public static Expression arrayReplace(String expression, Expression value1, Expression value2)
Returned expression results in new array with all occurrences of value1 replaced by value2.
public static Expression arrayReplace(JsonArray array, Expression value1, Expression value2)
Returned expression results in new array with all occurrences of value1 replaced by value2.
public static Expression arrayReplace(Expression expression, Expression value1, Expression value2, long n)
Returned expression results in new array with at most n occurrences of value1 replaced with value2.
public static Expression arrayReplace(String expression, Expression value1, Expression value2, long n)
Returned expression results in new array with at most n occurrences of value1 replaced with value2.
public static Expression arrayReplace(JsonArray array, Expression value1, Expression value2, long n)
Returned expression results in new array with at most n occurrences of value1 replaced with value2.
public static Expression arrayReverse(Expression expression)
Returned expression results in new array with all elements in reverse order.
public static Expression arrayReverse(String expression)
Returned expression results in new array with all elements in reverse order.
public static Expression arrayReverse(JsonArray array)
Returned expression results in new array with all elements in reverse order.
public static Expression arraySort(Expression expression)
Returned expression results in new array with elements sorted in N1QL collation order.
public static Expression arraySort(String expression)
Returned expression results in new array with elements sorted in N1QL collation order.
public static Expression arraySort(JsonArray array)
Returned expression results in new array with elements sorted in N1QL collation order.
public static Expression arraySum(Expression expression)
Returned expression results in the sum of all the non-NULL number values in the array, or zero if there are no such values.
public static Expression arraySum(String expression)
Returned expression results in the sum of all the non-NULL number values in the array, or zero if there are no such values.
public static Expression arraySum(JsonArray array)
Returned expression results in the sum of all the non-NULL number values in the array, or zero if there are no such values.
Copyright © 2014 Couchbase, Inc.