我的数据如下所示:
buffer = [{"siteid": 1 , "distance": 2, "codes": "1|b|c", "urv": "545"}, {"siteid": 2 , "distance": 2, "codes": "1|b|c", "urv": "55"}, {"siteid": 2 , "distance": 2, "codes": "1|b|c", "urv": "55"}, {"siteid": 3 , "distance": 2, "codes": "1|b|c", "urv": "546"}]
layer = [{"siteid": 2 }, {"siteid": 4 }, {"siteid": 3 }]
我希望能够返回 siteid 相同的缓冲区列表的所有成员。
结果将是:
[{"siteid": 2 , "distance": 2, "codes": "1|b|c", "urv": "55"}, {"siteid": 2 , "distance": 2, "codes": "1|b|c", "urv": "55"}, {"siteid": 3 , "distance": 2, "codes": "1|b|c", "urv": "546"}]
TIA,克里斯