Oihana PHP Arango

count.php

Table of Contents

Functions

count()  : string
Count the number of elements in an array.

Functions

count()

Count the number of elements in an array.

count(mixed $expression) : string

This helper wraps the ArangoDB AQL function COUNT(expression) which is an alias for LENGTH(expression). It returns the number of elements in the given array expression.

Example AQL usage:

COUNT(doc.tags)              // returns number of elements in doc.tags
COUNT([1, 2, 3, 4])         // returns 4
Parameters
$expression : mixed

Array expression to count elements of.

Tags
example
use function oihana\arango\db\functions\arrays\count;

$expr = count('doc.items');
// Produces: 'COUNT(doc.items)'
see
https://docs.arangodb.com/stable/aql/functions/array/#count
length()

For the equivalent LENGTH function.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results