Search code examples
jsonpath

Does JsonPath support the AND (&&) operator?


Does JsonPath support the AND (&&) operator?

Consider the following JsonPath expression:

$.values[?(@.level=='First' && @.type == 'Sales')].selectedValue

Is this the correct syntax for "And" conditions for elements within an array?

Thanks, JohnB


Solution

  • According to the most authorative spec it is not supported: https://goessner.net/articles/JsonPath/

    However, there is a draft for a new standard which seem to include and-operator and more: https://datatracker.ietf.org/wg/jsonpath/documents/