aqlUpsertExpression.php
Table of Contents
Functions
- aqlUpsertExpression() : string
- Builds the leading clause of an AQL `UPSERT` operation.
Functions
aqlUpsertExpression()
Builds the leading clause of an AQL `UPSERT` operation.
aqlUpsertExpression([array<string|int, mixed> $init = [] ]) : string
The ArangoDB syntax accepts the lookup as either a search expression or a filter expression — never both:
UPSERT [ searchExpression | FILTER filterExpression ]
Accordingly, exactly one of the two $init keys must be supplied:
AQL::SEARCH— an object literal matched by equality, rendered asUPSERT { … }(see aqlExpression()).AQL::FILTER— a more flexible filter expression, rendered asUPSERT FILTER …(see aqlFilter()).
Supplying neither, or both at the same time, throws an
InvalidArgumentException.
Parameters
- $init : array<string|int, mixed> = []
-
Associative array with exactly one of:
AQL::SEARCH: array|string — the search document.AQL::FILTER: array|string — the filter expression.
Tags
Return values
string —The UPSERT … clause.