I tried ever post I could find regarding this, but unfortunately no luck. I have this JSON:
json: '{"hook": {"target": "http://192.168.1.115:3000/webhook", "id": "camera-1", "event": "recognition", "filename": "camera-1_screenshots/24-06-17/22-19-20.653932.jpg"}, "data": {"camera_id": "camera-1", "filename": "camera-1_screenshots/24-06-17/22-19-20.653932.jpg", "timestamp": "2024-06-17T22:19:20.653932Z", "timestamp_local": "2024-06-17 22:19:20.653932+00:00", "results": [{"box": {"xmin": 437, "ymin": 660, "xmax": 562, "ymax": 714}, "plate": "34a36837", "region": {"code": "vn", "score": 0.558}, "score": 0.9, "candidates": [{"score": 0.9, "plate": "34a36837"}, {"score": 0.825, "plate": "34a36b37"}], "dscore": 0.843, "vehicle": {"score": 0.487, "type": "SUV", "box": {"xmin": 354, "ymin": 312, "xmax": 895, "ymax": 719}}, "direction": "", "source_url": "rtsp://platerec:[email protected]:8554/demo", "position_sec": "6766.925725685", "user_data": ""}]}}'
I want to get the value of “plate”. I currently try this:
obj.data[camera-1].results[0].plate
Where obj contains the JSON.
I get this error:
TypeError: Cannot read properties of undefined
Any help is much appreciated