Template string handler (template tag) for AQL queries.
aql tag can be used to write complex AQL queries as multi-line strings
without having to worry about
bindVars and the distinction between
collections and regular parameters.
Tagged template strings will return an AqlQuery object with
bindVars attributes reflecting any interpolated values.
Any ArangoCollection instance used in a query string will be recognized as a collection reference and generate an AQL collection bind parameter instead of a regular AQL value bind parameter.
Note: you should always use the
aql template tag when writing
dynamic AQL queries instead of using untagged (normal) template strings.
Untagged template strings will inline any interpolated values and return
a plain string as result. The
aql template tag will only inline references
to the interpolated values and produce an AQL query object containing both
the query and the values. This prevents most injection attacks when using
untrusted values in dynamic queries.
Constructs AqlQuery objects from an array of arbitrary values.
aql template strings is a much safer alternative
for most use cases. This low-level helper function only exists to
aql tag when constructing complex queries from dynamic
arrays of query fragments.
Array of values to join. These values will behave exactly
like values interpolated in an
aql template string.
Seperator to insert between values. This value will behave exactly like a value passed to aql.literal, i.e. it will be inlined as-is, rather than being converted into a bind parameter.
Marks an arbitrary scalar value (i.e. a string, number or boolean) as
safe for being inlined directly into AQL queries when used in an
template string, rather than being converted into a bind parameter.
aql template strings is a much safer alternative for
most use cases. This low-level helper function only exists to help with
rare edge cases where a trusted AQL query fragment must be read from a
string (e.g. when reading query fragments from JSON) and should only be
used as a last resort.
Generated using TypeDoc