Oihana PHP Arango

attributes.php

Table of Contents

Functions

attributes()  : string
Return the attribute keys of a document.

Functions

attributes()

Return the attribute keys of a document.

attributes(string $document[, bool|null $removeSystemAttrs = null ][, bool|null $sort = null ]) : string

Wraps the ArangoDB AQL function ATTRIBUTES(document, removeSystemAttrs, sort) (also aliased as KEYS()).

Example AQL usage:

ATTRIBUTES({b: 2, _key: "x", a: 1})              // returns ["b", "_key", "a"]
ATTRIBUTES({b: 2, _key: "x", a: 1}, true)        // returns ["b", "a"]
ATTRIBUTES({b: 2, _key: "x", a: 1}, true, true)  // returns ["a", "b"]
Parameters
$document : string

The document variable or expression.

$removeSystemAttrs : bool|null = null

Whether to omit system attributes (_id, _key, _rev, ...).

$sort : bool|null = null

Whether to sort the keys alphabetically.

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

$expr = attributes('doc');
// Produces: 'ATTRIBUTES(doc)'

$expr = attributes('doc', true, true);
// Produces: 'ATTRIBUTES(doc,true,true)'
see
https://docs.arangodb.com/stable/aql/functions/document-object/#attributes
keys()
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results