Still new to groovy here but I am trying to obtain all values from each map in my list of maps that have a key equal to "Oranges"
def resultSet = [
["Oranges":123456, "Apples": "none"],["Oranges":7890, "Apples": "some"]
]
def fruit = resultSet.each{
it.findAll{key, value -> key == "Oranges"}.value
}
println fruit
so for this, I would expect the result to be: [123456, 7890]
but I am getting: [[Oranges:123456, Apples:none], [Oranges:7890, Apples:some]]