问:在指定的JSON数据中(最外层是数组)根据指定条件拿到匹配到的结果
let carr = [{
"code": "000",
"agyTypeCode": "1",
"name": "某某市泽国区",
"pid": null,
"id": "21sadasdsa45dsadsa1w11ssdsw55wsd"
}, {
"code": "000001",
"agyTypeCode": "REGION",
"children": [{
"code": "01",
"agyTypeCode": "1",
"children": [{
"code": "0101",
"agyTypeCode": "1",
"children": [{
"finChfName": "推荐",
"isPairAc": 1,
"code": "0008",
"name": "二胎",
"agyCode": "0101",
"id": "24d0cb01b02211e8b1528dc623111881",
"acsCode": "001"
}, {
"finChfName": "查收",
"isPairAc": 0,
"code": "0009",
"name": "茶水草",
"agyCode": "0101",
"id": "8ce00b71b02211e8b1528dc623111881",
"acsCode": "003"
}, {
"finChfName": "两个",
"isPairAc": 1,
"code": "0010",
"name": "O(∩_∩)O哈哈~",
"agyCode": "0101",
"id": "12d2f801b02311e8bd661323180bdf18",
"acsCode": "001"
}, {
"finChfName": "啊啊",
"isPairAc": 1,
"code": "0013",
"name": "测试平行记账",
"agyCode": "0101",
"id": "b29c9e90c07711e8bef6315abdfc5989",
"acsCode": "001"
}, {
"finChfName": "啊啊啊",
"isPairAc": 0,
"code": "0014",
"name": "测试不是平行记账",
"agyCode": "0101",
"id": "e9830841c07711e8a4682ddcca113e60",
"acsCode": "002"
}, {
"finChfName": "啊啊啊",
"isPairAc": 0,
"code": "0015",
"name": "按时吃",
"agyCode": "0101",
"id": "f8d46e01c07811e8aa1929a828257f4d",
"acsCode": "002"
}, {
"finChfName": "打算",
"isPairAc": 1,
"code": "0017",
"name": "大萨达",
"agyCode": "0101",
"id": "7e7a9a41c16211e887ac6329230785bc",
"acsCode": "001"
}],
"name": "国家体育总部门经济司",
"pid": "f514a5a7e0d14e13aae98e47ec369a97",
"id": "b9c8b045fb3848c2ae3a7dc44e0db17b"
}],
"name": "国家体育总部门",
"pid": "ee22f49ae9c1400599f5d52acbbaa006",
"id": "f514a5a7e0d14e13aae98e47ec369a97"
}],
"name": "测试区划",
"pid": null,
"id": "ee22f49ae9c1400599f5d52acbbaa006"
}, {
"code": "009",
"agyTypeCode": "1",
"children": [{
"finChfName": "他他他",
"isPairAc": 0,
"code": "002",
"name": "行政数据",
"agyCode": "009",
"id": "24767c81349011e8aff46ff006323009",
"acsCode": "002"
}, {
"finChfName": "雷霆崖烈焰",
"isPairAc": 1,
"code": "0051",
"name": "是",
"agyCode": "009",
"id": "c98158e17f6211e88778c177655f0ba3",
"acsCode": "001"
}, {
"finChfName": "剖切",
"isPairAc": 1,
"code": "0053",
"name": "新会计制度(期末业务)",
"agyCode": "009",
"id": "2c95d8c1803511e89a37851b1a8b5408",
"acsCode": "001"
}, {
"finChfName": "张三",
"isPairAc": 1,
"code": "0121",
"name": "事业数据",
"agyCode": "009",
"id": "80d0a7e1cbd911e8bd4bd1c35525136a",
"acsCode": "001"
}, {
"finChfName": "啊啊",
"isPairAc": 1,
"code": "0128",
"name": "测试",
"agyCode": "009",
"id": "e4700fa1d5e011e8b887a9873dfd9ff1",
"acsCode": "001"
}],
"name": "某某市泽国区财政部门",
"pid": "ee22f49ae9c1400599f5d52acbbaa010",
"id": "ee22f49ae9c1400599f5d52acbb88009"
}, {
"code": "010",
"agyTypeCode": "AGEN",
"children": [{
"finChfName": "测试",
"isPairAc": 1,
"code": "0001",
"name": "行政",
"agyCode": "010",
"id": "15fe5ea07f6011e89490b3fa58ca1a1f",
"acsCode": "001"
}, {
"finChfName": "测试",
"isPairAc": 1,
"code": "0002",
"name": "测试",
"agyCode": "010",
"id": "2e2bd9507ff911e8bd8ce5ebdd3691a4",
"acsCode": "001"
}, {
"finChfName": "嗯",
"isPairAc": 1,
"code": "0007",
"name": "测试724",
"agyCode": "010",
"id": "1c4c07718f1511e89b3fe363a3d40d6b",
"acsCode": "001"
}, {
"finChfName": "孙振生",
"isPairAc": 0,
"code": "002",
"name": "行政数据",
"agyCode": "010",
"id": "24767c81349011e8aff46ff006323010",
"acsCode": "002"
}],
"name": "某某市泽国区信访部门",
"pid": "ee22f49ae9c1400599f5d52acbbaa010",
"id": "ee22f49ae9c1400599f5d52acbb88010"
}, {
"code": "022",
"agyTypeCode": "AGEN",
"children": [{
"finChfName": "楚云飞",
"isPairAc": 1,
"code": "0002",
"name": "地区数据",
"agyCode": "022",
"id": "663982b0831f11e88a4d05ce24bfba35",
"acsCode": "001"
}, {
"finChfName": "啊啊",
"isPairAc": 1,
"code": "0003",
"name": "测试",
"agyCode": "022",
"id": "17e1f3c0832611e89e41871149504fa5",
"acsCode": "001"
}, {
"finChfName": "aa",
"isPairAc": 1,
"code": "0014",
"name": "测试2",
"agyCode": "022",
"id": "14ff2ba1864611e8b71c29a3b3016125",
"acsCode": "001"
}, {
"finChfName": "王娜",
"isPairAc": 1,
"code": "0016",
"name": "wn测试数据",
"agyCode": "022",
"id": "1493d5f1866211e8be7a17c7191e695f",
"acsCode": "001"
}, {
"finChfName": "七月",
"isPairAc": 1,
"code": "0027",
"name": "七月",
"agyCode": "022",
"id": "26b504d1899511e8b1139f00fbd2f491",
"acsCode": "001"
}, {
"finChfName": "啊",
"isPairAc": 1,
"code": "0029",
"name": "啊啊啊啊",
"agyCode": "022",
"id": "e142ed0189ac11e8a943b36e0f97cad8",
"acsCode": "001"
}, {
"finChfName": "京东",
"isPairAc": 0,
"code": "0038",
"name": "ybk数据",
"agyCode": "022",
"id": "8e444c408b0811e8935bb38bf14dc4d5",
"acsCode": "002"
}, {
"finChfName": "测测测",
"isPairAc": 1,
"code": "0040",
"name": "测测测",
"agyCode": "022",
"id": "ff5855318b2511e8895bc71f69695839",
"acsCode": "001"
}, {
"finChfName": "地方",
"isPairAc": 1,
"code": "0043",
"name": "测试333",
"agyCode": "022",
"id": "e57553508b3111e8a2148d98b1a6b4c9",
"acsCode": "001"
}, {
"finChfName": "哦屁",
"isPairAc": 1,
"code": "0045",
"name": "周星驰",
"agyCode": "022",
"id": "cec127618b3611e8a45ecf53378eacfd",
"acsCode": "001"
}, {
"finChfName": "让人",
"isPairAc": 0,
"code": "0051",
"name": "前期",
"agyCode": "022",
"id": "34e1cee1907411e895aeb3268240930f",
"acsCode": "002"
}, {
"finChfName": "测试oracle",
"isPairAc": 0,
"code": "0054",
"name": "测试oracle",
"agyCode": "022",
"id": "ae1cf381979e11e89b283709976946b2",
"acsCode": "002"
}],
"name": "某某市泽国区科学技术部门",
"pid": "ee22f49ae9c1400599f5d52acbbaa010",
"id": "ee22f49ae9c1400599f5d52acbb88022"
}, {
"code": "302",
"agyTypeCode": "1",
"children": [{
"code": "302001",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 1,
"code": "0001",
"name": "地区数据",
"agyCode": "302001",
"id": "b4d0b6f0d2de11e8b3ff6531e1dc713e",
"acsCode": "001"
}],
"name": "湖北省环境保护厅本级",
"pid": "aaf65c00af4011e8ba0e4bb47edc5366",
"id": "b926dde0af4011e8ba0e4bb47edc5366"
}],
"name": "湖北省环境保护厅",
"pid": "",
"id": "aaf65c00af4011e8ba0e4bb47edc5366"
}, {
"code": "555",
"agyTypeCode": "1",
"children": [{
"code": "555001",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555001",
"id": "c9484f80d20c11e897a897a9c63972b2",
"acsCode": "005"
}, {
"finChfName": null,
"isPairAc": 0,
"code": "0002",
"name": "科学事业单位数据",
"agyCode": "555001",
"id": "dc624b70d20c11e897a897a9c63972b2",
"acsCode": "004"
}],
"name": "民族委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836160"
}, {
"code": "555002",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555002",
"id": "2fec2380d12511e89f0605f50d407345",
"acsCode": "005"
}],
"name": "宪法和法律委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836161"
}, {
"code": "555003",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555003",
"id": "6cef62c0d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "监察和司法委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836162"
}, {
"code": "555004",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555004",
"id": "75fe8610d12511e89f0605f50d407345",
"acsCode": "005"
}],
"name": "财政经济委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836163"
}, {
"code": "555005",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555005",
"id": "7e1d3010d20d11e8a2a5bb48be4c326f",
"acsCode": "005"
}],
"name": "教育科学文化卫生委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836164"
}, {
"code": "555006",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555006",
"id": "7e1d5720d20d11e8a2a5bb48be4c326f",
"acsCode": "005"
}],
"name": "外事委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836165"
}, {
"code": "555007",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555007",
"id": "92a69a80d20d11e8a2a5bb48be4c326f",
"acsCode": "005"
}],
"name": "华侨委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836166"
}, {
"code": "555008",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555008",
"id": "6cef62c1d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "环境与资源保护委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836167"
}, {
"code": "555009",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555009",
"id": "6cef62c2d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "农业与农村委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836168"
}, {
"code": "555010",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555010",
"id": "6cef62c3d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "社会建设委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836169"
}, {
"code": "555011",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555011",
"id": "6cef62c4d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "代表资格审查委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836170"
}, {
"code": "555012",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555012",
"id": "6cef62c5d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "预算工作委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836171"
}, {
"code": "555013",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555013",
"id": "6cef62c6d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "香港基本法委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836172"
}, {
"code": "555014",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555014",
"id": "6cef62c7d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "澳门基本法委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836173"
}, {
"code": "555015",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555015",
"id": "6cef62c8d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "秘书部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836174"
}, {
"code": "555016",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555016",
"id": "6cef62c9d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "研究室",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836175"
}, {
"code": "555017",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555017",
"id": "6cef62cad2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "联络部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836176"
}, {
"code": "555018",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555018",
"id": "6cef62cbd2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "外事部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836177"
}, {
"code": "555019",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555019",
"id": "6cef62ccd2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "新闻部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836178"
}, {
"code": "555020",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555020",
"id": "6cef62cdd2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "人事部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836179"
}, {
"code": "555021",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555021",
"id": "6cef62ced2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "机关事务管理部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836180"
}, {
"code": "555022",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555022",
"id": "6cef62cfd2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "机关党委",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836181"
}, {
"code": "555023",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555023",
"id": "6cef62d0d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "机关纪委",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836182"
}, {
"code": "555024",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555024",
"id": "6cef62d1d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "机关工会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836183"
}, {
"code": "555025",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555025",
"id": "6cef62d2d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "信访部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836184"
}, {
"code": "555026",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555026",
"id": "6cef62d3d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "中国位置制度理论研究会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836185"
}, {
"code": "555027",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555027",
"id": "6cef89d0d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "中央纪委驻某地区位置机关纪检组",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836186"
}, {
"code": "555028",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555028",
"id": "6cef89d1d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "常委会会场",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836187"
}, {
"code": "555029",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555029",
"id": "6cef89d2d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "信息中心(本级)",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836188"
}, {
"code": "555030",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555030",
"id": "6cef89d3d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "法制工作委员会",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836189"
}, {
"code": "555031",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555031",
"id": "6cef89d4d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "离退休干部部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836190"
}, {
"code": "555032",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555032",
"id": "6cef89d5d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "采购中心",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836191"
}, {
"code": "555033",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555033",
"id": "6cef89d6d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "大会堂管理部门",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836192"
}, {
"code": "555034",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555034",
"id": "6cef89d7d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "机关服务中心",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836193"
}, {
"code": "555035",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555035",
"id": "6cef89d8d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "信息中心",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836194"
}, {
"code": "555036",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555036",
"id": "6cef89d9d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "培训中心",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836195"
}, {
"code": "555037",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555037",
"id": "6cef89dad2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "图书馆",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836196"
}, {
"code": "555038",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555038",
"id": "6cef89dbd2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "会议中心",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836197"
}, {
"code": "555039",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "555039",
"id": "6cef89dcd2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "杂志社",
"pid": "617289d0d04411e8bd8033bd2a0fffdf",
"id": "1051724173375836198"
}],
"name": "某地区位置",
"pid": "",
"id": "617289d0d04411e8bd8033bd2a0fffdf"
}, {
"code": "777",
"agyTypeCode": "1",
"children": [{
"code": "777001",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 0,
"code": "0001",
"name": "中小学校数据",
"agyCode": "777001",
"id": "efe6c290d2c811e8a5199f3621c38b01",
"acsCode": "005"
}],
"name": "秘书部门",
"pid": "62a366d0ced211e8b747731b606acef5",
"id": "73ca4550ced211e8b747731b606acef5"
}, {
"code": "777002",
"agyTypeCode": "1",
"children": [{
"finChfName": null,
"isPairAc": 1,
"code": "0002",
"name": "地区数据",
"agyCode": "777002",
"id": "a64a3100d4fb11e8b679555649b719c9",
"acsCode": "001"
}],
"name": "人事部门",
"pid": "62a366d0ced211e8b747731b606acef5",
"id": "825d5990ced211e8b747731b606acef5"
}],
"name": "某地区位置测试数据",
"pid": "",
"id": "62a366d0ced211e8b747731b606acef5"
}]
let dobj =
{"agyCode":"0101",
"agyName":"国家体育总局经济司",
"acbCode":"0008",
"acbName":"二胎",
"acsCode":"001"}
function find(arr, fn, result) {
arr.forEach(item => {
if (item.children) {
find(item.children, fn, result)
} else {
if (fn(item)) {
result.push(item)
}
}
})
}
var result = []
find(carr, item => {
return item.name == dobj.acbName && item.code == dobj.acbCode && item.agyCode == dobj.agyCode
}, result)
console.log(result);
会从整个数组中遍历满足条件dobj的东西
最后的结果会是:
问:在指定的JSON数据中(最外层是数组)根据指定条件拿到匹配到的结果的更多相关文章
- 处理Json数据中的日期类型.如/Date(1415169703000)/格式
在asp.net mvc后台返回到视图中的json数据中想对数据进行操作,发现日期类型无法直接进行操作,需要转换为指定格式才行.在网上也搜了下方法也很多,觉得有点麻烦,最终使用正则搞定了,分享下: v ...
- 我的Android进阶之旅------>解决Jackson、Gson解析Json数据时,Json数据中的Key为Java关键字时解析为null的问题
1.问题描述 首先,需要解析的Json数据类似于下面的格式,但是包含了Java关键字abstract: { ret: 0, msg: "normal return.", news: ...
- C#调用接口返回json数据中含有双引号 或其他非法字符的解决办法
这几天,调用别人接口返回json数据含有特殊符号(双引号),当转换成json对象总是报错, json字符格式如下 { "BOXINFO":[ { ", "ITE ...
- 从JSON数据中取出相关数据
参考: http://www.cnblogs.com/shuilangyizu/p/6019561.html JSON数据如下: { "total": 1, "rows& ...
- JS 取Json数据中对象特定属性值
解析JSON JSON 数据 var str = '[{"a": "1","b": "2"}, {"a&quo ...
- Json数据中同字段不同数据类型的解析
当解析Json数据时,如果碰到同字段不同数据类型的情况,如何处理呢?比如: [ { "code": 1, "data": 33 }, { "code& ...
- Json数据中的特殊字符处理
今天在项目中遇到一个问题,页面上的数据突然显示不出来了,查验后得知是Json数据出现了问题.使用JSON从后台向前台传输数据的时候,当数据本身含有一些特殊字符,会导致JSON数据的解析出错.如果内容中 ...
- JsonPath如何获取JSON数据中的值
场景: 发送接口请求后,得到请求结果值是Json数据, 需要从Json数据信息中提取字段值. 响应值字符与字符之间有空格,导致用正则表达式方法提取比较麻烦,于是用java的JsonPath方法提取快速 ...
- ajax 请求json数据中json对象的构造获取问题
前端的界面中,我想通过ajax来调用写好的json数据,并调用add(data)方法进行解析,请求如下: json数据如下: { “type”:"qqq", "lat&q ...
随机推荐
- python-day1(学前了解)
Markdown基本语法 各级标题 # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 加粗 **加粗文本** 斜体 *我斜了* 高亮 ==我高亮了== 上标 2 ...
- JDK1.8+API+中文文档+高清完整版(不要积分 免费拿)
JDK1.8+API+中文文档+高清完整版+CHM帮助文档 链接: https://pan.baidu.com/s/1LbdWSZ4qFjWXdJ88bXkn5w 提取码: frew 希望能帮上大家的 ...
- joomla core注入漏洞
注入语句如下: payload1 = '/index.php?option=com_fields&view=fields&layout=modal&list[fullorder ...
- awk 快速批量kill 进程
ps -ef|grep aaa|grep -v grep|awk '{print "kill -9 " $2}' |sh
- 解决ssh登录很慢的问题以及jumpserver登录主机出现:Authentication timeout
一.问题 登录ssh输入用户名后,等待很长时间20-30秒左右才显示输入密码提示框,从而导致通过jumpserver堡垒机登录主机时,报错:Authentication timeout Opt> ...
- JSONP 跨域请求原理
0x00 简介 由于浏览器的同源策略,我们想要从别的域获取数据变得困难,需要特殊的技术才能获取 0x01 使用 客户域:client.com 服务器(他域):server.com 如客户想访问 : h ...
- Java并发编程实战 第2章 线程安全性
编写线程安全的 代码,核心在与对共享的和可变的对象的状态的访问. 如果多个线程访问一个可变的对象时没有使用同步,那么就会出现错误.在这种情况下,有3中方式可以修复这个问题: 不在线程之间共享该状态变量 ...
- CodeForces-916B-Jamie and Binary Sequence(changed after round)(构造)
链接: https://vjudge.net/problem/CodeForces-916B 题意: Jamie is preparing a Codeforces round. He has got ...
- Mac SIP系统完整性保护如何关闭
方法/步骤1: 打开Mac终端输入命令:csrutil status 它会显示关闭的话是disable,开启的话是enabled.默认情况下是开启的所以要关闭. 方法/步骤2: 点击桌面的apple ...
- 两个惊艳的python库:tqdm和retry
转载到请包括本文地址:http://spaces.ac.cn/archives/3902/ Python基本是我目前工作.计算.数据挖掘的唯一编程语言(除了符号计算用Mathematica外).当然, ...