I was trying to compose an array of objects, adding a property and kept getting errors, until I randomly tried `$.` and everything worked. Couldn't find mentions in the docs about `$.` though. Input: ```json { "state": [ { "text": "one", "data": [ -1, -2, -3 ] }, { "text": "two", "data": [ 4, 5, 6 ] } ], "metadata": { "title": "something" // <=== static value to use } } ``` Output desired: ```json [ { "x": "one", "y": [ -1, -2, -3 ], "title": "something" // <=== static value outside the arrays }, { "x": "two", "y": [ 4, 5, 6 ], "title": "something" // <=== static value outside the arrays } ] ``` Attempts: state[].{ x: text, y: data, title: metadata.title } => title is null (see below) state[].{ x: text, y: data, title: `metadata.title` } => syntax error state[].{ x: text, y: data, title: $metadata.title } => Error referencing undefined variable metadata state[].{ x: text, y: data, title: $.metadata.title } => ** SUCCESS ** Result when using `state[].{ x: text, y: data, title: metadata.title }` ```json [ { "x": "one", "y": [ -1, -2, -3 ], "title": null }, { "x": "two", "y": [ 4, 5, 6 ], "title": null } ] ```
Activity
springcomp commentedon Apr 4, 2025
The
$root-nodereference is definitely not supported in this library.However, it is supported in our JMESPath Community implementation of this library.
Are you sure you are using the library from this repository? 🤔