Open samer1977 opened 6 months ago
Hi,
Sorry maybe my brain still thinks the other way but how would you solve this problem: https://github.com/bazaarvoice/jolt/issues/700
I cant think of a way without having to create custom recursive max\min as in:
def max_array(array)
if(size($array)==0) null else if(size($array)==1) $array[0]
else max($array[0],max_array($array[1:]))
vs
{
"minPrice": min([for(.prices).price]) "minPrice": max([for(.prices).price])
}
Thanks
You're right that there is no other way at the moment. max() and min() should perhaps also have single-argument versions that accept an array.
max()
min()
Hi,
Sorry maybe my brain still thinks the other way but how would you solve this problem: https://github.com/bazaarvoice/jolt/issues/700
I cant think of a way without having to create custom recursive max\min as in:
def max_array(array)
if(size($array)==0) null else if(size($array)==1) $array[0]
else max($array[0],max_array($array[1:]))
vs
{
"minPrice": min([for(.prices).price]) "minPrice": max([for(.prices).price])
}
Thanks