Rediger

Del via


ARRAY_CONCAT (NoSQL query)

APPLIES TO: NoSQL

Returns an array that is the result of concatenating two or more array values.

Syntax

ARRAY_CONCAT(<array_expr_1>, <array_expr_2> [, <array_expr_N>])  

Arguments

Description
array_expr_1 The first expression in the list.
array_expr_2 The second expression in the list.
array_expr_N (Optional) Optional expression[s], which can contain a variable number of expressions up to the Nth item in the list.

Note

The ARRAY_CONCAT function requires at least two array expression arguments.

Return types

Returns an array expression.

Examples

The following example shows how to concatenate two arrays.

SELECT
    ARRAY_CONCAT(["apples", "strawberries"], ["bananas"]) AS arrayConcat
[
  {
    "arrayConcat": [
      "apples",
      "strawberries",
      "bananas"
    ]
  }
]

Remarks

  • This function doesn't utilize the index.