I am querying a db and getting the below response and stored the db response in refData variable. And def refData = here is my db query. below is my json array response
[
{
"ref": 1
},
{
"ref": 2
},
{
"ref": 3
},
{
"ref": 4
},
{
"ref": 5
}
]
I tried printing refData[0]
.ref then it prints 1
I tried these but it does not work.
refData.ref
refData[*].ref
refData[$].ref
how to fetch only the numbers. my expected output is [1,2,3,4,5]