Given some JSON:
{
"A": 1,
"B" : 2,
"C": 3
}
I'd expect this Jasonata statement $spread($)[*=2]
to gives these results (which it does indeed):
{
"B": 2
}
But when I use what I believe to be semantically the same statement but use the chain operator: $~>$spread()[*=2]
it gives the results:
[
{
"A": 1
},
{
"B": 2
},
{
"C": 3
}
]
Could anyone explain why Jsonata processes those two statements which in my estimation should yield identical results, but are handled so differently? Is there something I don't understand about the chain operator?
Thanks in advance!