我有一个字典列表,其中每个字典都有相同的键,只是不同的值。我可以循环遍历列表并获取我想要的“ip”属性,但它是一个很大的列表,并且想知道是否没有可以更好地工作的查找命令。这是该列表的一个小示例:
"current": [
{
"fvSubnet": {
"attributes": {
"annotation": "",
"childAction": "",
"configIssues": "",
"ctrl": "",
"debugMessage": "",
"descr": "",
"dn": "uni/tn-MYBD/BD-VLAN_10/subnet-[114.66.71.17/28]",
"extMngdBy": "",
"ip": "114.66.71.17/28",
"ipDPLearning": "enabled",
"lcOwn": "local",
"modTs": "2023-07-11T08:18:19.497+00:00",
"monPolDn": "uni/tn-common/monepg-default",
"name": "",
"nameAlias": "",
"preferred": "yes",
"scope": "public",
"status": "",
"uid": "19044",
"userdom": ":all:",
"virtual": "yes"
}
}
},
{
"fvSubnet": {
"attributes": {
"annotation": "",
"childAction": "",
"configIssues": "",
"ctrl": "nd",
"debugMessage": "",
"descr": "",
"dn": "uni/tn-MYBD/BD-VLAN_20/subnet-[1008:125:0:e56::1/64]",
"extMngdBy": "",
"ip": "1008:125:0:e56::1/64",
"ipDPLearning": "enabled",
"lcOwn": "local",
"modTs": "2023-07-11T08:18:19.497+00:00",
"monPolDn": "uni/tn-common/monepg-default",
"name": "",
"nameAlias": "",
"preferred": "no",
"scope": "public",
"status": "",
"uid": "19044",
"userdom": ":all:",
"virtual": "no"
}
}
}
]
我只对每个字典中的“ip”属性感兴趣。我可以进行查找并获取所有内容,还是需要循环遍历字典列表?