Oihana PHP Arango

unsetAttributes.php

Table of Contents

Functions

unsetAttributes()  : string
Remove the given top-level attributes from a document.

Functions

unsetAttributes()

Remove the given top-level attributes from a document.

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

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

Named unsetAttributes() rather than unset() because unset is a reserved PHP keyword.

Example AQL usage:

UNSET(doc, "_id", "_rev")   // a copy of doc without its _id and _rev attributes
Parameters
$document : string

The document variable or expression.

$attributes : string

The attribute names to remove.

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

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

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results