I have a JSON string that I get from an express GET request which queries a mongo db.
res.write(string)
gives me:
[
{
"_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"
}
}
]
However, I want to only render certain information from the string, for example: epc, audit, ss.ts, v3.ts and v3.location.
How do I do this?
You can use res.json and filter by the desired fields.
Or you can use
res.write
and filter the results: