aqlRemove.php
Table of Contents
Functions
- aqlRemove() : string
- Remove one or multiple documents from a collection using an AQL `REMOVE` operation.
Functions
aqlRemove()
Remove one or multiple documents from a collection using an AQL `REMOVE` operation.
aqlRemove([array{collection?: ?string, expression?: ?string, key?: ?string, options?: ?array{exclusive?: bool, ignoreErrors?: bool, ignoreRevs?: bool, refillIndexCaches?: bool, waitForSync?: bool}} $init = [] ]) : string
This helper builds a valid AQL query string for removing documents based on either:
- a custom key expression, or
- a document key (
_key) and an optional document prefix (defaults todoc).
AQL syntax:
REMOVE <keyExpression> IN <collection> [OPTIONS {...}]
Parameters
- $init : array{collection?: ?string, expression?: ?string, key?: ?string, options?: ?array{exclusive?: bool, ignoreErrors?: bool, ignoreRevs?: bool, refillIndexCaches?: bool, waitForSync?: bool}} = []
-
Initial options array.
- 'collection' : The name of the collection in which the document should be updated.
By default, if the argument is null, use
@@collectionbindVars definition. - 'expression' : The key expression that contains the document identification. If the expression is null or an empty string, the 'key' and 'prefix' definitions are used.
- 'key' : The unique identifier of the document to remove. By default
_key-> REMOVE doc._key IN ... - 'options' : Build a RemoveOptions definition to inject at the end of the query.
- 'prefix' : Optional The name of the document reference. By default
doc-> REMOVE doc._key IN ...
- 'collection' : The name of the collection in which the document should be updated.
By default, if the argument is null, use
Tags
Return values
string —The compiled AQL REMOVE statement.