keep.php
Table of Contents
Functions
- keep() : string
- Keep only the given top-level attributes of a document.
Functions
keep()
Keep only the given top-level attributes of a document.
keep(string $document, string ...$attributes) : string
Wraps the ArangoDB AQL function KEEP(document, attributeName1, … attributeNameN).
The attribute names are emitted as quoted string literals (json_encode), so AQL
receives a valid call; the document stays a raw expression.
Example AQL usage:
KEEP(doc, "name", "age") // a copy of doc with only its name and age attributes
Parameters
- $document : string
-
The document variable or expression.
- $attributes : string
-
The attribute names to keep.
Tags
Return values
string —The formatted AQL expression.