aqlRepsert.php
Table of Contents
Functions
- aqlRepsert() : string
- Prepare a REPSERT query to replace an existing document or insert a new one if it does not exist.
Functions
aqlRepsert()
Prepare a REPSERT query to replace an existing document or insert a new one if it does not exist.
aqlRepsert([array<string|int, mixed> $init = [] ]) : string
UPSERT [ searchExpression | FILTER filterExpression ]
INSERT insertExpression
REPLACE replaceExpression
IN collection
Options in $init:
collection: string|null, name of the collection.filter: array|string|null, optional filter expression.search: array|string|null, the search document.insert: array|string|null, the document to insert if no match is found.replace: array|string|null, the document to replace if a match is found.options: array|QueryOptions|string|JsonSerializable|null, optional upsert options.return: optional expression to define the RETURN clause. Default is Clause::NEW. You can also use Clause::WITH_STATUS to return both the document and the type of operation.
Parameters
- $init : array<string|int, mixed> = []
-
Configuration options for the REPSERT query.
Tags
Return values
string —The generated AQL UPSERT query.