aqlReplace.php
Table of Contents
Functions
- aqlReplace() : string
- The REPLACE statement replaces an existing document with a new one, removing any attributes that are not explicitly set in the provided `doc` while preserving immutable system attributes (`_id`, `_key`, `_rev`).
Functions
aqlReplace()
The REPLACE statement replaces an existing document with a new one, removing any attributes that are not explicitly set in the provided `doc` while preserving immutable system attributes (`_id`, `_key`, `_rev`).
aqlReplace([ReplaceOptions|null, with?: string|null} $init = [] ]) : string
Basic Syntax:*
REPLACE `document` IN `collection`
REPLACE `keyExpression` WITH `document` IN `collection`
Parameters
- $init : ReplaceOptions|null, with?: string|null} = []
-
Initial options for the REPLACE statement, with the keys:
- 'collection' : The collection in which the document is replaced, written verbatim (default
@@collection). - 'doc' : The document expression that replaces (
REPLACE <doc> IN …), used when 'with' is absent (defaultdoc). - 'key' : The key expression that 'with' applies to (
REPLACE <key> WITH …), used with 'with' only (defaultdoc). - 'options' : The default 'options' expression definition
- 'with' : The replacement document for 'key' (
REPLACE <key> WITH <with> IN …). It is not the AQLWITHcollections clause.
'doc', 'key' and 'with' are written verbatim : build a document with aqlDocument(), which takes the 'rawKeys' / 'rawValues' / 'useSpace' options. This function reads none of them, and a PHP array passed here is not formatted.
- 'collection' : The collection in which the document is replaced, written verbatim (default