Oihana PHP Arango

keepRecursive.php

Table of Contents

Functions

keepRecursive()  : string
Keep only the given attributes of a document, recursing into sub-documents.

Functions

keepRecursive()

Keep only the given attributes of a document, recursing into sub-documents.

keepRecursive(string $document, string ...$attributes) : string

Wraps the ArangoDB AQL function KEEP_RECURSIVE(document, attributeName1, … attributeNameN). The attribute names are emitted as quoted string literals (json_encode); the document stays a raw expression.

Example AQL usage:

KEEP_RECURSIVE(doc, "name", "meta")   // keeps name/meta at every nesting level
Parameters
$document : string

The document variable or expression.

$attributes : string

The attribute names to keep at every level.

Tags
example
use function oihana\arango\db\functions\documents\keepRecursive;

$expr = keepRecursive('doc', 'name', 'meta');
// Produces: 'KEEP_RECURSIVE(doc,"name","meta")'
see
https://docs.arangodb.com/stable/aql/functions/document-object/#keep_recursive
keep()
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results