jeudi 30 septembre 2021

filter key-value pair in json array object [duplicate]

i have json module with 3 json array with given objects as follows:

i want to filter out the array with following result based on the condition : Id = '1234' and Description = "Issued"

expected result should be an object of above conditions as:

result = {
  "Description" = "xyz"}

ARRAY OF OBJECTS:

[
    "Id" : "5678",
    "Code" : "Issued",
    "Description" : "hijklmnop"
},
{
    "Id" : "1234",
    "Code" : "MFC",
    "Description" : "abcdefg"
},
{
    "Id" : "1234",
    "Code" : "Issued",
    "Description" : "xyz"
}

]

Aucun commentaire:

Enregistrer un commentaire