var vJson =
'{"tpaCo":[{"name":"Audit Company1", \
"aud":[{"name":"auditor1","asgn":"1","fnds":"1","lead":"1"}, \
{"name":"auditor2","asgn":"1","fnds":"0","lead":"1"}, \
{"name":"auditor3","asgn":"0","fnds":"1","lead":"0"}, \
{"name":"auditor4","asgn":"1","fnds":"1","lead":"0"}, \
{"name":"auditor5","asgn":"1","fnds":"1","lead":"0"}, \
{"name":"auditor6","asgn":"0","fnds":"1","lead":"0"}, \
{"name":"auditor7","asgn":"1","fnds":"1","lead":"0"}, \
{"name":"auditor8","asgn":"1","fnds":"1","lead":"0"}, \
{"name":"auditor9","asgn":"0","fnds":"1","lead":"0"}, \
{"name":"auditor10","asgn":"1","fnds":"1","lead":"0"}, \
{"name":"auditor11","asgn":"1","fnds":"1","lead":"0"}]}, \
{"name":"Audit Company2", \
"aud":[{"name":"auditor3","asgn":"0","fnds":"0","lead":"1"}, \
{"name":"auditor4","asgn":"0","fnds":"0","lead":"0"} \
] \
} \
]}';
var vObj = JSON.parse(vJson);
有什么方法可以过滤 JSON 对象。例如,我想搜索audit1 * asgn * 值。过滤器可以是动态的,就像它可以是 audit1 或 audit11。我也想知道如何将上面的 json 转换为数组。这将使我的搜索变得容易(以防无法通过直接 JSON 搜索进行搜索)。