Oihana PHP Arango

min.php

Table of Contents

Functions

min()  : string
Return the smallest element of an array.

Functions

min()

Return the smallest element of an array.

min(mixed $anyArray) : string

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

Example AQL usage:

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

Array expression to find minimum value from.

Tags
example
use function oihana\arango\db\functions\numerics\min;

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

For finding maximum value.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results