现在我正在使用 vibed JSON 模块,但我不知道如何在不使用 foreach 迭代的情况下访问嵌套元素。
这是我的 JSON:
{
"hasMore": false,
"result": [{
"ip": "127.0.0.1",
"passedtests": "[firsttest8,firsttest8,firsttest8,firsttest8]",
"guid": ""
}],
"code": 201,
"extra": {
"stats": {
"writesIgnored": 0,
"scannedIndex": 0,
"scannedFull": 1,
"executionTime": 0,
"filtered": 0,
"writesExecuted": 0
},
"warnings": []
},
"error": false,
"cached": false
}
我想做类似的事情:result.passedtests
. 但这里的结果是一个数组。