有以下数据
[
{
"id":1,
"children":[
{
"id":11
},
{
"id":12
}
]
},
{
"id":2,
"children":[
{
"id":21
},
{
"id":22
}
]
},
{
"id":3,
"children":[
{
"id":21
},
{
"id":32
}
]
}
]
过滤掉id=21的数据,得到:
[
{
"id":1,
"children":[
{
"id":11
},
{
"id":12
}
]
},
{
"id":2,
"children":[
{
"id":22
}
]
},
{
"id":3,
"children":null
}
]
请问如何实现?
结果