我需要过滤字典数组,但在我的结构中,一些值是null
"data": [
{
"date": "2019-04-12 00:00:00",
"points": 825,
"trips": [
{
"id": 108,
"trip_detail": “<null>”
}
},
{
"date": "2019-04-11 00:00:00",
"points": 2475,
"trips": [
{
"id": 73,
"trip_detail": {
"id": 53,
"score": 8.25,
"points": 825,
}
},
{
"id": 74,
"trip_detail": {
"id": 54,
"score": 8.25,
"points": 825,
}
},
所以在上面的结果中我需要删除第一个字典数组以及该数组。
使用filter循环遍历集合并返回仅包含与include条件匹配的元素的Array。