Oihana PHP Arango

notNull.php

Table of Contents

Functions

notNull()  : string
Builds an AQL expression return the first element that is not null, and null if all alternatives are null themselves.

Functions

notNull()

Builds an AQL expression return the first element that is not null, and null if all alternatives are null themselves.

notNull(mixed ...$alternative) : string

It is also known as COALESCE() in SQL.

This helper wraps the ArangoDB AQL function NOT_NULL().

Example AQL output:

RETURN NOT_NULL(null, null, "foo", "bar") // "foo"
Parameters
$alternative : mixed

input of arbitrary type

Tags
example
use function oihana\arango\db\functions\notNull;

$expr = notNull('user.email');
// Produces: 'NOT_NULL(user.email)'
see
https://docs.arangodb.com/stable/aql/functions/miscellaneous/#not_null
since
1.0.0

author Marc Alcaraz

Return values
string

The formatted AQL expression (e.g. 'NOT_NULL(user.email)').

On this page

Search results