arrayRemoveAt
Description
Returns a new array with the element at the specified position removed.
- The element type must match the array type.
- Supported element types include
string,bool,number,interval,timestamp,regexp, andenum. - Positions are 0-indexed.
Syntax
Like many functions in DataPrime, arrayRemoveAt supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| array | array | true | The array to modify |
| position | number | true | The index of the element to remove (0-indexed) |
Example
Use case: Remove an item from a queue by position
Suppose you have a list of jobs and want to remove the job at a specific position. Consider the following input:
By removing the element at index 2, the array will no longer include "Job 3".
Example query
Example output
The result will include the updated array without the element at that position:
Theme
Light