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 name of the collection in which the document should be replaced.
- 'doc' : An object and contain the attributes and values to replace.
- 'options' : The default 'options' expression definition
- 'rawValues' : array, keys whose values should be treated as raw AQL expressions - used with the 'with' option)
- 'rawKeys' : array, keys which should be kept raw (their values are not wrapped or converted) - used with the 'with' option)
- 'useSpace' : bool, add spaces around braces and after commas
- 'with' : One or multiple collections for WITH clause -> WITH collection1 [, collection2 [, ... collectionN ] ]