has.php
Table of Contents
Functions
- has() : string
- Returns an AQL expression to test whether an attribute exists in a document.
Functions
has()
Returns an AQL expression to test whether an attribute exists in a document.
has(string $document, string $attributeName) : string
This helper wraps the ArangoDB AQL function HAS(document, attributeName) which
returns true if the document has an attribute named attributeName, even if its
value is falsy (null, 0, false, or empty string).
Example AQL usage:
HAS(doc, "name") // returns true if doc has a "name" attribute
HAS(doc, "email") // returns true if doc has an "email" attribute
HAS(doc, "nonExistent") // returns false if attribute doesn't exist
Parameters
- $document : string
-
The document variable or expression to test.
- $attributeName : string
-
The attribute key to test for existence.
Tags
Return values
string —The formatted AQL expression.