Oihana PHP Arango

keys.php

Table of Contents

Functions

keys()  : string
Return the attribute keys of a document (an alias of {@see attributes()} / `ATTRIBUTES()`).

Functions

keys()

Return the attribute keys of a document (an alias of {@see attributes()} / `ATTRIBUTES()`).

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

Wraps the ArangoDB AQL function KEYS(document, removeSystemAttrs, sort).

Example AQL usage:

KEYS({b: 2, a: 1})         // returns ["b", "a"]
KEYS({b: 2, a: 1}, false, true)   // returns ["a", "b"] (sorted)
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\keys;

$expr = keys('doc');
// Produces: 'KEYS(doc)'

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

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results