DocumentDB SQL Array Function - DocumentDB SQL

What are Array Functions in DocumentDB SQL?

The array functions perform an operation on an array input value and return in the form of numeric, Boolean or array value.
Some of the built-in array functions are as follows:

Function & Description
ARRAY_LENGTH (arr_expr)
Returns the number of elements of the specified array expression.
ARRAY_CONCAT (arr_expr, arr_expr [, arr_expr])
Returns an array that is the result of concatenating two or more array values.
ARRAY_CONTAINS (arr_expr, expr)
Returns a Boolean indicating whether the array contains the specified value.
ARRAY_SLICE (arr_expr, num_expr [, num_expr])
Returns part of an array expression.

An example is illustrated below where some built-in array functions are used.

builtin array

Following is the query with different array functions.

When the above query is executed, it produces the following output.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

DocumentDB SQL Topics