I have a json file where I want to search for a device (ex. AEVL2020) and will return multiple results based on "registers". I tried to search on the net but didn't find any clue. So I want an output like this:
"12":{
"user_id": "1",
"employee_id": "12",
"name": "Juan Dela Cruz",
"privilege": "0"
},
"32":{
"user_id": "2",
"employee_id": "32",
"name": "Pedro Dela Cruz",
"privilege": "0"
}
Here is my json:
{
"devices": {
"AEVL2020":{
"deviceSerialId": "AEVL2020"
},
"AEVL2021":{
"deviceSerialId": "AEVL2021"
}
},
"registers":{
"AEVL2020":{
"12":{
"user_id": "1",
"employee_id": "12",
"name": "Juan Dela Cruz",
"privilege": "0"
},
"32":{
"user_id": "2",
"employee_id": "32",
"name": "Pedro Dela Cruz",
"privilege": "0"
}
},
"AEVL2021":{
"29":{
"user_id": "1",
"employee_id": "29",
"name": "Maria Dela Cruz",
"privilege": "0"
},
"222":{
"user_id": "2",
"employee_id": "222",
"name": "Jay Dela Cruz",
"privilege": "0"
}
}
}
}