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:

S.No.
Function & Description
1
ARRAY_LENGTH (arr_expr)
Returns the number of elements of the specified array expression.
2
ARRAY_CONCAT (arr_expr, arr_expr [, arr_expr])
Returns an array that is the result of concatenating two or more array values.
3
ARRAY_CONTAINS (arr_expr, expr)
Returns a Boolean indicating whether the array contains the specified value.
4
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 DMCA.com Protection Status

DocumentDB SQL Topics