merge.php
Table of Contents
Functions
- merge() : string
- Merge multiple documents into a single document.
Functions
merge()
Merge multiple documents into a single document.
merge(string|array<string|int, mixed>|null $documents) : string
This helper wraps the ArangoDB AQL function MERGE(document1, document2, ... documentN)
which merges multiple documents into a single document. Later documents override
attributes from earlier documents if they have the same key.
Example AQL usage:
MERGE(doc1, doc2) // merges doc1 and doc2
MERGE(doc1, doc2, doc3) // merges three documents
MERGE({a: 1}, {b: 2}) // returns {a: 1, b: 2}
MERGE({a: 1}, {a: 2}) // returns {a: 2} (later overrides)
Parameters
- $documents : string|array<string|int, mixed>|null
-
Multiple documents to merge (at least 2 required).
Tags
Return values
string —The formatted AQL expression.