Oihana PHP Arango

removeValues.php

Table of Contents

Functions

removeValues()  : string
Remove all occurrences of multiple values from an array.

Functions

removeValues()

Remove all occurrences of multiple values from an array.

removeValues(string $anyArray, string $values) : string

This helper wraps the ArangoDB AQL function REMOVE_VALUES(anyArray, values) which removes all occurrences of multiple specified values from an array. The values parameter should be an array expression containing the values to remove.

Example AQL usage:

REMOVE_VALUES([1, 2, 3, 2, 4, 3], [2, 3])    // returns [1, 4]
REMOVE_VALUES(doc.tags, ["old", "deprecated"]) // removes multiple tags
Parameters
$anyArray : string

Array expression to remove values from.

$values : string

Array expression containing values to remove.

Tags
example
use function oihana\arango\db\functions\arrays\removeValues;

$expr = removeValues('doc.tags', '["old", "deprecated"]');
// Produces: 'REMOVE_VALUES(doc.tags, ["old", "deprecated"])'
see
https://docs.arangodb.com/stable/aql/functions/array/#remove_values
removeValue()

For removing a single value.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results