Filter expression after recursive descent

Setup

Selector: $..[?(@.id==2)]

{"id": 2, "more": [{"id": 2}, {"more": {"id": 2}}, {"id": {"id": 2}}, [{"id": 2}]]}

Results

Other responses

Bash (JSONPath.sh)

[
  2,
  2
]

C (json-glib)

Not supported

Unable to compile selector `$..[?(@.id==2)]': Missing member name or wildcard after . character

Clojure (json-path) ¹

[
  2,
  2,
  2,
  2,
  2,
  [
    {
      "id": 2
    },
    {
      "more": {
        "id": 2
      }
    },
    {
      "id": {
        "id": 2
      }
    },
    [
      {
        "id": 2
      }
    ]
  ],
  [
    {
      "id": 2
    }
  ],
  {
    "more": {
      "id": 2
    }
  }
]

Cpp (jsoncons)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Dart (json_path)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Elixir (ExJsonPath)

Not supported

syntax error before: '['

Elixir (jaxon)

[]

Elixir (warpath) ¹

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Erlang (ejsonpath)

Not supported

syntax error before: '['

Golang (github.com-PaesslerAG-jsonpath) ¹

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Golang (github.com-bhmj-jsonslice) ¹ ³

[]

Golang (github.com-ohler55-ojg)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Golang (github.com-spyzhov-ajson)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Golang (github.com-vmware-labs-yaml-jsonpath)

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Haskell (jsonpath)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

JavaScript (Goessner) ²

[
  2,
  2,
  2,
  2,
  2,
  [
    {
      "id": 2
    },
    {
      "more": {
        "id": 2
      }
    },
    {
      "id": {
        "id": 2
      }
    },
    [
      {
        "id": 2
      }
    ]
  ],
  {
    "id": 2
  },
  {
    "id": 2
  }
]

JavaScript (brunerd)

[
  2,
  2,
  2,
  2,
  2,
  [
    {
      "id": 2
    },
    {
      "more": {
        "id": 2
      }
    },
    {
      "id": {
        "id": 2
      }
    },
    [
      {
        "id": 2
      }
    ]
  ],
  {
    "id": 2
  },
  {
    "id": 2
  }
]

JavaScript (jsonpath)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

JavaScript (jsonpath-plus)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Java (com.github.jsurfer)

[
  [
    {
      "id": 2
    }
  ],
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": {
      "id": 2
    }
  },
  {
    "more": {
      "id": 2
    }
  }
]

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=4

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

PHP (galbar-jsonpath) ²

Not supported

Invalid JSONPath error: 'Error in JSONPath near '..[?(@.id==2)]''

PHP (remorhaz-jsonpath)

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

PHP (softcreatr-jsonpath)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Python (jsonpath) ²

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Python (jsonpath-ng)

Not supported

JsonPathLexerError('Error on line 1, col 4: Unexpected character: ? ')

Python (jsonpath-rw)

Not supported

JsonPathLexerError('Error on line 1, col 4: Unexpected character: ? ')

Python (jsonpath2)

Not supported

line 1:11 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}
ValueError("line 1:11 extraneous input '=' expecting {'@', '$', 'true', 'false', 'null', '{', '[', STRING, NUMBER}")

Raku (JSON-Path)

Not supported

Evaluation of embedded Perl 6 code not allowed (construct with :allow-eval)

Ruby (jsonpath)

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Rust (jsonpath_plus)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Scala (jsonpath)

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Swift (Sextant)

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

dotNET (Json.NET)

[
  {
    "id": 2,
    "more": [
      {
        "id": 2
      },
      {
        "more": {
          "id": 2
        }
      },
      {
        "id": {
          "id": 2
        }
      },
      [
        {
          "id": 2
        }
      ]
    ]
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

dotNET (JsonCons.JsonPath)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

dotNET (JsonPath.Net)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

dotNET (JsonPathLib)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

dotNET (Manatee.Json)

Not supported

Unrecognized JSON Path element. Path up to error: '$'

JSON (Path_Reference_Implementation)

Not supported

 --> 1:3
  |
1 | $..[?(@.id==2)]
  |   ^---
  |
  = expected childName

Proposal (A)

[
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  },
  {
    "id": 2
  }
]

Errors

Golang (github.com-oliveagle-jsonpath) ¹

expression don't support in filter

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

non-safe evaluation, died at main.pl line 11.

Footnotes