{"action":"opened","issue":{"url":"https://api.github.com/repos/jmespath/jmespath.js/issues/6","labels_url":"https://api.github.com/repos/jmespath/jmespath.js/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/jmespath/jmespath.js/issues/6/comments","events_url":"https://api.github.com/repos/jmespath/jmespath.js/issues/6/events","html_url":"https://github.com/jmespath/jmespath.js/issues/6","id":95680512,"number":6,"title":"Recursive flatten","user":{"login":"edsilv","id":1334393,"avatar_url":"https://avatars.githubusercontent.com/u/1334393?v=3","gravatar_id":"","url":"https://api.github.com/users/edsilv","html_url":"https://github.com/edsilv","followers_url":"https://api.github.com/users/edsilv/followers","following_url":"https://api.github.com/users/edsilv/following{/other_user}","gists_url":"https://api.github.com/users/edsilv/gists{/gist_id}","starred_url":"https://api.github.com/users/edsilv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsilv/subscriptions","organizations_url":"https://api.github.com/users/edsilv/orgs","repos_url":"https://api.github.com/users/edsilv/repos","events_url":"https://api.github.com/users/edsilv/events{/privacy}","received_events_url":"https://api.github.com/users/edsilv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-17T15:32:14Z","updated_at":"2015-07-17T15:32:14Z","closed_at":null,"body":"Hi,\r\n\r\nIs it possible to retrieve a flattened list of nodes recursively for a tree of arbitrary depth? I know that the flatten operator isn't recursive, but is there some other pattern that can be used?\r\n\r\nSo for this data:\r\n\r\n    {\r\n      \"node\": {\r\n         \"label\": \"root node\",\r\n         \"nodes\": [\r\n           {\r\n             \"label\": \"node 1\",\r\n             \"nodes\": [\r\n               {\r\n                 \"label\": \"node 1:1\"\r\n               },\r\n               {\r\n                 \"label\": \"node 1:2\"\r\n               }\r\n             ]\r\n           },\r\n           {\r\n             \"label\": \"node 2\",\r\n             \"nodes\": [\r\n               {\r\n                 \"label\": \"node 2:1\"\r\n               },\r\n               {\r\n                 \"label\": \"node 2:2\"\r\n               }\r\n             ]\r\n           }\r\n         ] \r\n       }\r\n    }\r\n\r\nI could get:\r\n\r\n    [\r\n      {\r\n        \"label\": \"root node\" \r\n      },\r\n      {\r\n        \"label\": \"node 1\" \r\n      },\r\n      {\r\n        \"label\": \"node 1:1\" \r\n      },\r\n      {\r\n        \"label\": \"node 1:2\" \r\n      },\r\n      {\r\n        \"label\": \"node 2\" \r\n      },\r\n      {\r\n        \"label\": \"node 2:1\" \r\n      },\r\n      {\r\n        \"label\": \"node 2:2\" \r\n      }\r\n    ]\r\n"}}