arrayRemove - Remove given element from array
arrayRemove
will remove a given element from an array and return the modified array.
Syntax
Arguments
Name | Type | Required | Description |
---|---|---|---|
array | array of type T | true | T must be either string , bool , number , interval , timestamp , regexp or enum |
element | T | true | T must be either string , bool , number , interval , timestamp , regexp or enum |
Example - Removing a job from the middle of a queue
Consider the following document:
Removing an item from the array can be done as follows:
This results in the following document:
Try it yourself
Open up your explore screen and enter the following command:
create values from ['Job 1', 'Job 2', 'Job 3', 'Job 4']
| create updated_values from values.arrayRemove('Job 3')
Theme
Light