a = [
{
"id" : 15,
"name" : "abc"
},
{
"id" : 16,
"name" : "xyz"
},
{
"id" : 17,
"name" : "pqr"
}
]
b = [15,17]
I have two lists as above, I want to remove the object from list a if its id is not present in list b. Any help, how to do that?
Output List:
[
{
"id" : 15,
"name" : "abc"
},
{
"id" : 17,
"name" : "pqr"
}
]