1

How can I get all properties, expect those with value null using jmespath?

{
    "foo": 10,
    "bar": null,
    "qux": ["Hello", "World"]
}

I'd like the result to be

{
    "foo": 10,
    "qux": ["Hello", "World"]
}
dreftymac
  • 31,404
  • 26
  • 119
  • 182
Arnold Daniels
  • 16,516
  • 4
  • 53
  • 82
  • As far as I can see there is still no way to filter the keys of a dictionary. For a list, as you probably know, the answer would be something like `jmespath.search('[?@!=null]', json.loads('[1,null,2]'))` I see no reason why such a filter could not exist in jmespath but it doesn't. – Max Murphy Apr 06 '17 at 22:36

0 Answers0