Any
Syntax:
Any(array[])
Returns true if there are one or more elements in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array to be checked. |
Returns:
bool
Any($.Courses[*])
Avg
Syntax:
Avg(array[])
Returns the average of the elements in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array of numbers to be averaged. |
Returns:
decimal
Avg($.Courses[*].Price)
ChunkBy
Syntax:
ChunkBy(array[], size)
Chunks the elements in the array[] into batches of the provided size.
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array to be chunked. |
size | int | The size of each chunk. |
Returns:
ChunkBy($.Courses[*], 5)
Count
Syntax:
Count(array[])
Returns the number of elements in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array whose elements are to be counted. |
Returns:
int
Count($.Courses[*])
Distinct Count
Syntax:
DCount(array[])
Returns the distinct number of elements in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array whose distinct elements are to be counted. |
Returns:
int
DCount($.Courses[*])
Empty
Syntax:
Empty(param1)
Returns true if param1 is null or empty.
Array
Parameters:
Name | Type | Description |
---|---|---|
param1 | string | The string to be checked. |
Returns:
bool
Empty(”)
Returns `true`.
First
Syntax:
First(array[])
Returns the first element in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array from which the first element is to be returned. |
Returns:
object
First($.Courses)
First
Syntax:
First(array[], param1, selector)
Returns the first element in the array[] that matches the filter expression and returns the object or value of the selector expression.
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array to be searched. |
param1 | string | The filter expression. |
selector | string | The selector expression. |
Returns:
object
First($.Courses[*], @.Name = ‘Maths’)
First($.Courses[*], @.Name = ‘Maths’).id
GroupBy
Syntax:
GroupBy(array[], selector)
Groups the elements in the array[] by the selector.
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array to be grouped. |
selector | string | The property to group by. |
Returns:
object: {‘Key’:123, ‘Group’:[]}
GroupBy($.Courses, ‘Category’)
In
Syntax:
In(array[], param1)
Returns true if param1 is in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array to be searched. |
param1 | object | The object to be checked. |
Returns:
bool
In(‘Maths’, $.Courses[*].Name)
IsEmpty
Syntax:
IsEmpty(array[], param2)
Returns the original array if it is not empty. If the array is empty, returns the specified return value.
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | array | The array to be evaluated for emptiness |
param2 | object | The value to be returned if the array is empty |
Returns:
array or object
IsEmpty([], ‘Array is empty’)
Returns `’Array is empty’` if the input array is empty.
IsEmpty([‘Course 1’, ‘Course 2’], ‘Array is empty’)
Returns `[‘Course 1’, ‘Course 2’]` if the input array is not empty.
Join
Syntax:
Join(array[], param2)
Joins the elements in the array[] using param2 as the separator and returns a string.
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array of strings to be joined. |
param2 | string | (Optional) The separator string. |
Returns:
string
Join($.Courses[*].Name, ‘, ‘)
Last
Syntax:
Last(array[])
Returns the last element in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array from which the last element is to be returned. |
Returns:
object
Last($.Courses)
Last
Syntax:
Last(array[], param1, selector)
Returns the last element in the array[] that matches the filter expression and returns the object or value of the selector expression.
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array to be searched. |
param1 | string | The filter expression. |
selector | string | The selector expression. |
Returns:
object
Last($.Courses[*], @.Name = ‘Maths’)
Last($.Courses[*], @.Name = ‘Maths’).id
Max
Syntax:
Max(array[])
Returns the largest element in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array from which the maximum value is to be returned. |
Returns:
object
Max($.Courses[*].Price)
Min
Syntax:
Min(array[])
Returns the smallest element in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array from which the minimum value is to be returned. |
Returns:
object
Min($.Courses[*].Price)
Sum
Syntax:
Sum(array[])
Returns the sum of the elements in the array[].
Array
Parameters:
Name | Type | Description |
---|---|---|
array[] | json array | The array of numbers to be summed. |
Returns:
decimal
Sum($.Courses[*].Price)
ToArray
Syntax:
ToArray(param1, param2, param3, ...)
Converts param1, param2, param3, … into an array.
Array
Parameters:
Name | Type | Description |
---|---|---|
param1 | object | The first element of the array. |
param2 | object | The second element of the array. |
param3 | object | The third element of the array. |
… | object | Additional elements of the array. |
Returns:
array
ToArray(1, 2, 3)