aqlInsert.php
Table of Contents
Functions
- aqlInsert() : string
- Builds an AQL `INSERT` statement.
Functions
aqlInsert()
Builds an AQL `INSERT` statement.
aqlInsert([array<string|int, mixed> $init = [] ][, array<string|int, mixed>|null &$binds = null ][, string|null $queryID = null ]) : string
This method dynamically constructs an ArangoDB AQL query of the form:
INSERT {document} INTO collection OPTIONS {...} RETURN NEW
It supports binding collection names, attaching additional insert options, and optionally returning the newly inserted document.
The $init array may contain:
AQL::DOCUMENT(array|object|string) — The document to insert.AQL::COLLECTION(string) — The target collection name.AQL::BIND_COLLECTION(bool) — Whether to bind the collection as a variable.AQL::QUERY_ID(string) — An optional query identifier to prepend the default name of the bind collection variable.AQL::RAW_VALUES(array) — Keys in the document whose values should be treated as raw AQL expressions.AQL::USE_SPACE(bool) — Whether to add spaces around braces and commas for readability.
Parameters
- $init : array<string|int, mixed> = []
-
An associative array containing the insert parameters.
- $binds : array<string|int, mixed>|null = null
-
A reference array to hold bind variables for the query.
- $queryID : string|null = null
Tags
Return values
string —The compiled AQL INSERT query string, ready to be executed.