arrayConcat - Join two arrays together
The arrayConcat
function will join the elements of two arrays together, to produce one array with elements of both.
Syntax
Like many functions in DataPrime, arrayConcat
supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
Name | Type | Required | Description |
---|---|---|---|
array1 | array of type T | true | T must be either string , bool , number , interval , timestamp , regexp or enum |
array2 | array of type T | true | T must be either string , bool , number , interval , timestamp , regexp or enum |
Example - Creating a global view of waiting jobs
Consider the following document:
{
"processing_jobs_waiting": ["job1", "job2", "job3"],
"loading_jobs_waiting": ["loading_job1", "loading_job2", "loading_job3"]
}
If we want to see all processing
and loading
jobs in one place, we can use arrayConcat
:
This will result in the following document:
{
"processing_jobs_waiting": ["job1", "job2", "job3"],
"loading_jobs_waiting": ["loading_job1", "loading_job2", "loading_job3"],
"all_jobs": ["job1", "job2", "job3", "loading_job1", "loading_job2", "loading_job3"]
}
Theme
Light