isKey.php
Table of Contents
Functions
- isKey() : string
- Builds an AQL expression that checks whether a value is a valid document key.
Functions
isKey()
Builds an AQL expression that checks whether a value is a valid document key.
isKey(string $value) : string
This helper wraps the ArangoDB AQL function IS_KEY(), which tests if
the given value is a string that can be used as the _key attribute of a document.
The function returns true if the string matches ArangoDB’s key format rules:
- Contains only letters, digits, and the characters
_,-,:, or@. - Does not contain
/, whitespace, or control characters. - Must not be empty.
Example AQL output:
IS_KEY(user._key)
Parameters
- $value : string
-
The AQL field or string expression to check (e.g.
'user._key').
Tags
Return values
string —The formatted AQL expression (e.g. 'IS_KEY(user._key)').