What is the best way to get access to nested JSON in D? -
now using vibed json module, not know how access nested elements without iteration foreach.
here 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 }
i like: result.passedtests
. here result array.
i found perfect solution:
json resultpassedtestsjson = visitorsinfo["result"][0]["passedtests"]; // "[firsttest8,firsttest8,firsttest8,firsttest8]"
[0]
because result
array, , access it's first element.
Comments
Post a Comment