How do you get JSONPath for the whole child node object?
eg:.
var data = [{ "key1": { "children": [{ "key2": "value", "key3": "value", "key4": {} }, { "key2": "value", "key3": "value", "key4": {} }], "key5": "value" } }, { "key1": { "children": { "key2": "value", "key3": "value", "key4": {} }, "key5": "value" } }]
I want to get the absolute path for all nodes in the data structure as an array:
[ "data[0]['key1']['children'][0]['key2']", "data[0]['key1']['children'][0]['key3']", "data[0]['key1']['children'][0]['key4']", ......, "data[0]['key1']['children'][1]['key2']", ......., "data[1]['key1']['children']['key2']", .......... ]
Is there any way to do this in JS?
source share