Oihana PHP Arango

concat.php

Table of Contents

Functions

concat()  : string
Concatenate multiple values into a single string.

Functions

concat()

Concatenate multiple values into a single string.

concat(array<string|int, mixed>|string|null $arguments) : string

This helper wraps the ArangoDB AQL function CONCAT(value1, value2, ... valueN) which concatenates multiple values into a single string. Values are automatically converted to strings during concatenation.

Example AQL usage:

CONCAT("Hello", " ", "World")     // returns "Hello World"
CONCAT(doc.firstName, " ", doc.lastName)  // concatenates name parts
CONCAT("ID: ", doc._key)          // returns "ID: 123"
Parameters
$arguments : array<string|int, mixed>|string|null

An AQL string expression or an array of AQL values.

Tags
example
use function oihana\arango\db\functions\strings\concat;

$expr = concat(['"Hello"', '" "', '"World"']);
// Produces: 'CONCAT("Hello", " ", "World")'

$expr = concat('doc.firstName, " ", doc.lastName');
// Produces: 'CONCAT(doc.firstName, " ", doc.lastName)'
throws
UnsupportedOperationException
see
https://docs.arangodb.com/stable/aql/functions/string/#concat
concatSeparator()

For concatenating with a separator.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results