0
mongo dbを照会する明示的なGETリクエストからJSON文字列を取得しました。HTTP node.jsでJSON配列をレンダリング
res.write(string)
が私に与える:
[
{
"_id":{
"epc":"30742503C40AE4AE128918B1",
"audit":109
},
"ss":{
"x":1674,
"y":96,
"ts":"2016-05-09T02:24:03.000Z",
"regions":[
419,
416,
415,
401
]
},
"v3":{
"ts":"1970-01-01T00:00:00.000Z",
"sts":"2016-05-09T16:10:16.549Z",
"location":"A002R028S03100100"
}
}
]
をしかし、私は例えば、唯一の文字列から特定の情報をレンダリングする:EPC、監査、ss.ts、v3.tsをおよびv3.location。
どうすればよいですか?
おかげで、シモを。あなたの答えは本当に助けになりました。私はそれを発見した:res.write(JSON.stringify({epc:d._id.epc、監査:d._id.audit、upc:d.gtin、desc:d.item.desc、ss:d.ss.regions 、v3:d.v3.location})+ '\ n')は私が必要としていたものです。 –