Oihana PHP Arango

max.php

Table of Contents

Functions

max()  : string
Return the greatest element of an array.

Functions

max()

Return the greatest element of an array.

max(mixed $anyArray) : string

This helper wraps the ArangoDB AQL function MAX(anyArray) which returns the maximum value from an array. The array is not limited to numbers and can contain any comparable values.

Example AQL usage:

MAX([5, 2, 9, 2])             // returns 9
MAX(doc.scores)               // returns highest score
MAX(["a", "b", "c"])          // returns "c"
Parameters
$anyArray : mixed

Array expression to find maximum value from.

Tags
example
use function oihana\arango\db\functions\aqlArray;
use function oihana\arango\db\functions\numerics\max;

$expr = max('[5, 2, 9, 2]');
// Produces: 'MAX([5, 2, 9, 2])'

$expr = max( aqlArray( [1,2,3] ) ) ;
// Produces: 'MAX([5, 2, 9, 2])'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#max
aqlArray()

To convert a value to an AQL array expression.

min()

For finding minimum value.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results