Oihana PHP Arango

aqlLet.php

Table of Contents

Functions

aqlLet()  : string
The LET operation defines a variable within an AQL query, which can then be used in subsequent expressions.

Functions

aqlLet()

The LET operation defines a variable within an AQL query, which can then be used in subsequent expressions.

aqlLet(string $variableName, string $expression[, bool $useParentheses = false ][, bool $trim = false ]) : string

A variable defined with LET exists only for the scope of the query or subquery.

Syntax:

LET variableName = expression

Example usage:

$query = let('total', 'SUM(doc.amount)');
// LET total = SUM(doc.amount)

Another examples:

$query = let('userName', "CONCAT(user.firstName, ' ', user.lastName)");
// LET userName = CONCAT(user.firstName, ' ', user.lastName)
$query = let( 'surface', 'doc.width * doc.height' , true );
// LET surface = ( doc.width * doc.height )
Parameters
$variableName : string
$expression : string
$useParentheses : bool = false
$trim : bool = false
Tags
since
1.0.0
author

Marc Alcaraz

Return values
string
On this page

Search results