arrayContains.php
Table of Contents
Functions
- arrayContains() : string
- Build an AQL array "question mark" inline filter `array[? <quantifier> FILTER <condition>]`.
Functions
arrayContains()
Build an AQL array "question mark" inline filter `array[? <quantifier> FILTER <condition>]`.
arrayContains(string $array, string $condition[, string $quantifier = Char::EMPTY ]) : string
Unlike arrayFilter() ([* FILTER cond], which returns the matching
sub-array), the question-mark operator returns a boolean: whether the
array contains elements satisfying $condition under the given quantifier. It
is the direct, idiomatic way to write the existential LENGTH(array[* FILTER cond]) > 0 and, with a quantifier, the ALL / NONE / AT LEAST (n) variants.
Supported quantifiers (omitted = "at least one"):
''→ at least one element matches (default);ANY/ALL/NONE;AT LEAST (n)→ at leastnelements match.
$condition is interpolated verbatim — callers build it from trusted/whitelisted
pieces (bound values, validated fields, …).
Parameters
- $array : string
-
The array expression to test (e.g.
doc.contactPoint). - $condition : string
-
The FILTER condition tested on each element.
- $quantifier : string = Char::EMPTY
-
An optional quantifier (
ANY,ALL,NONE,AT LEAST (n)); empty = at least one.
Tags
Return values
string —The formatted AQL boolean array-contains expression.