HasFacetArrayComplex
Builds the AQL filter fragment for a {@see Facet::ARRAY_COMPLEX} facet: it keeps documents whose embedded array property holds at least one element matching the requested sub-field conditions. Composed into the model via {@see FacetTrait}.
Tags
Table of Contents
Methods
- prepareFacetArrayComplex() : string
- Prepares an array complex facet.
Methods
prepareFacetArrayComplex()
Prepares an array complex facet.
protected
prepareFacetArrayComplex(string $key, mixed $value, array<string|int, mixed> &$binds[, array<string|int, mixed> $facet = [] ][, string $docRef = AQL::DOC ]) : string
Keeps documents whose embedded array property ($docRef.$key) holds at
least one element matching the requested sub-field conditions, expressed
as an existential traversal LENGTH(FOR e IN $docRef.$key FILTER ... ) > 0.
The value is an object of subField: condition pairs; each condition may
be a single value or a list, and any value may be negated with a leading
- (!=). Negation is inline in the existential, so it keeps documents
having an element that does NOT equal the value (not "exclude the value").
Parameters
- $key : string
-
The facet key, also the embedded array property name.
- $value : mixed
-
The sub-field conditions (object of value or list).
- $binds : array<string|int, mixed>
-
The bind variables, populated by reference.
- $facet : array<string|int, mixed> = []
-
The facet definition (reads a facet-wide
Facet::ALT, applied to every sub-field). - $docRef : string = AQL::DOC
-
The document reference the array is read from (default
doc).