Skip to content

max\min against arrays #351

@samer1977

Description

@samer1977

Hi,

Sorry maybe my brain still thinks the other way but how would you solve this problem:
bazaarvoice/jolt#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions