-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Labels
Description
I've had no luck figuring out this nuance. I'm trying to convert data to a timeseries format required by another system. It wants the data as an array of arrays like this: http://try.jsonata.org/BkKNErBxL
Input:
[
{"epochSeconds":1578381600,"value": 3},
{"epochSeconds":1578381700,"value": 5}
]
Expression: $.[value,epochSeconds]
Result:
[
[3,1578381600],
[5,1578381700]
]
This is correct, but when there is only one item in the input array the result gets flattened.
Input:
[
{"epochSeconds":1578381600,"value": 3}
]
Desired Output:
[
[3,1578381600]
]
What I'm getting:
[
3,
1578381600
]
Is there some way to force an outer enclosing array when there is only one data point? TIA
markmelville