Oihana PHP Arango

unsetRecursive.php

Table of Contents

Functions

unsetRecursive()  : string
Remove the given attributes from a document, recursing into sub-documents.

Functions

unsetRecursive()

Remove the given attributes from a document, recursing into sub-documents.

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

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

Example AQL usage:

UNSET_RECURSIVE(doc, "_id", "_rev")   // strips _id/_rev at every nesting level
Parameters
$document : string

The document variable or expression.

$attributes : string

The attribute names to remove at every level.

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

$expr = unsetRecursive('doc', '_id', '_rev');
// Produces: 'UNSET_RECURSIVE(doc,"_id","_rev")'
see
https://docs.arangodb.com/stable/aql/functions/document-object/#unset_recursive
unsetAttributes()
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results