在其他线程上寻找时,问题没有得到如何在数组中获取 JSON 对象我已经看过的问题 -
如何在邮递员中从 JSONArray 中获取 JSONobject
如何从 JSON 对象中获取数组?
到目前为止我所尝试的 -
var jsonData = JSON.parse(responseBody);
var jsonObject = jsonData.events[2];
console.log("jsonobject - " + jsonObject);
控制台输出 -
jsonobject - [object Object]
json 响应看起来像这样 -
[
{
"$ts": "2019-06-14T06:21:55.2221392Z",
"values": [
"43912",
"CountIn",
"neet.row.mac3.indexinput",
"mac3",
"mac3",
"mac3",
300,
11,
1,
"mac3",
"2019-06-14T06:21:55.2221392Z",
"2019-06-14T06:22:55.2221392Z",
"manager",
"lead",
"consultant",
"5ca1e66d7eb20a11f00e502c
]
},
{
"$ts": "2019-06-14T06:23:54.3263475Z",
"values": [
"44272",
"indexinput",
"neet.row.mac2.indexinput",
"mac2",
"mac2",
"mac2",
300,
11,
1,
"mac2",
"2019-06-14",
"2019-06-14",
"Head",
"Master",
"Student",
"5ca1e66d7eb20a11f00e502c"
]
},
{
"$ts": "2019-06-14T06:24:54.3753534Z",
"values": [
"44452",
"indexinput",
"neet.row.mac.indexinput",
"mac",
"mac",
"mac",
300,
11,
1,
"Neet",
"2019-06-14T06:24:54.3753534Z",
"something1",
"something2 of something1",
"something3 of something2 ",
"5ca1e66d7eb20a11f00e502c"
]
}
]