Skip to main content

$$flat

Flatten an array of arrays (non array elements will remain)

note

All null elements are removed from result

Usage​

{ 
"$$flat": /* Array of arrays / elements */
}
"$$flat:{input}"

Returns​

array

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of arrays / elements

Examples​

Input

Definition

Output

[
[
"a",
"b",
"c"
],
[
"d",
"e",
"f"
]
]
{
"$$flat": [
"$[0]",
"$[1]"
]
}
[
"a",
"b",
"c",
"d",
"e",
"f"
]
[
[
"a",
"b",
"c"
],
[
"d",
"e",
"f"
]
]
{
"$$flat": [
"$[0]",
"$.pointingToNowhere"
]
}
[
"a",
"b",
"c"
]
[
[
"a",
"b",
"c"
],
[
"d",
"e",
"f"
]
]
{
"$$flat": [
[
"a",
"b",
"c"
],
[
"d",
"e",
"f"
]
]
}
[
"a",
"b",
"c",
"d",
"e",
"f"
]
[
"a",
"b",
"c"
]
{
"$$flat": [
[
"a",
"b",
"c"
],
[]
]
}
[
"a",
"b",
"c"
]
[
"a",
"b",
"c"
]
{
"$$flat": [
[
"a",
"b",
"c"
],
null
]
}
[
"a",
"b",
"c"
]