3

In the jq filtering language the . filter expression simply returns the input JSON unaltered (except for pretty printing). E.g.

$ echo '{"foo": true, "bar": 42}' | jq '.'
{
  "foo": true,
  "bar": 42
}

Does JMESPath have a similar expression (aka identity function)?

Alex Willmer
  • 491
  • 4
  • 14

1 Answers1

2

The current-node operator performs this function in JMESPath, e.g.

$ echo '{"foo": true, "bar": 42}' | ~/.local/go/bin/jp @
{
  "bar": 42,
  "foo": true
}

Thanks to jdevillard on https://gitter.im/jmespath/chat for the answer.

Alex Willmer
  • 491
  • 4
  • 14