Filter expression with equals object

Setup

Selector: $[?(@.d=={"k":"v"})]

[
  {
    "d": {
      "k": "v"
    }
  },
  {
    "d": {
      "a": "b"
    }
  },
  {
    "d": "k"
  },
  {
    "d": "v"
  },
  {
    "d": {}
  },
  {
    "d": []
  },
  {
    "d": null
  },
  {
    "d": -1
  },
  {
    "d": 0
  },
  {
    "d": 1
  },
  {
    "d": "[object Object]"
  },
  {
    "d": "{\"k\": \"v\"}"
  },
  {
    "d": "{\"k\":\"v\"}"
  },
  "v"
]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(@.d=={"k":"v"})]': Invalid array index definition “?(@.d=={"k":"v"})]”

Clojure (json-path) ¹

[
  {
    "d": null
  },
  "v"
]

Cpp (jsoncons)

[
  {
    "d": {
      "k": "v"
    }
  }
]

Dart (json_path)

Not supported

Instance of 'ParserException': end of input expected (at 1:2)

Elixir (ExJsonPath)

Not supported

illegal characters "{"

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

Parser error: Invalid token on line 1, syntax error before: <<"k">>

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(@.d=={"k":"v"})]	:1:10 - 1:11 unexpected "{" while scanning extensions

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-oliveagle-jsonpath) ¹

[]

Golang (github.com-theory-jsonpath)

Not supported

jsonpath: unexpected '{' at position 10

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

Not supported

invalid filter term at position 9, following "=="

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(@.d=={"k":"v"})]
 Error: 1:10:
  |
1 | $[?(@.d=={"k":"v"})]
  |          ^^^^^
unexpected "{"k":"
expecting "false", "null", "true", '!', '"', '$', ''', '@', digit, or white space

JavaScript (Goessner) ²

[
  {
    "d": "[object Object]"
  }
]

JavaScript (brunerd)

[]

JavaScript (jsonpath)

[
  {
    "d": "[object Object]"
  }
]

JavaScript (jsonpathly)

[
  {
    "d": {
      "k": "v"
    }
  }
]

Java (com.github.jsurfer)

Not supported

line 1:9 no viable alternative at input '@.d=={'
org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.github.xmljacquard.ajp)

Not supported

Error at char 18 in expression in xsl:sequence/@select on line 20 column 67 of ajp-runner.xslt:
   <failed xmlns:ixml="http://invisiblexml.org/NS"
  ixml:state="failed"><line>1</line><column>10</column><pos>10</pos><unexpected>{</unexpected><permitted>"'", #9, #A, #D, ' ', '"', '$', '-', '0', '@', 'f', 'n', 't', ['1'-'9'], ['a'-'z']</permitted><completions><completed rule="comparison-op" start="8" end="9"><input>==</input></completed><completed rule="name-segment" start="6" end="7"><input>.d</input></completed><completed rule="child-segment" start="6" end="7"><input>.d</input></completed><completed rule="segment" start="6" end="7"><input>.d</input></completed><completed rule="singular-query-segments" start="6" end="7"><input>.d</input></completed><completed rule="rel-singular-query" start="5" end="7"><input>@.d</input></completed><completed rule="segments" start="6" end="7"><input>.d</input></completed><completed rule="singular-query" start="5" end="7"><input>@.d</input></completed></completions><could-be-next><in rule="DIGIT1"><tokens>['1'-'9']</tokens></in><in rule="current-node-identifier"><tokens>'@'</tokens></in><in rule="int"><tokens>'0'</tokens></in><in rule="root-identifier"><tokens>'$'</tokens></in><in rule="false"><tokens>'f'</tokens></in><in rule="null"><tokens>'n'</tokens></in><in rule="LCALPHA"><tokens>['a'-'z']</tokens></in><in rule="string-literal"><tokens>"'", '"'</tokens></in><in rule="B"><tokens>#9, #A, #D, ' '</tokens></in><in rule="true"><tokens>'t'</tokens></in></could-be-next><unfinished><open rule="comparison-expr" start="5" end="9"><input>@.d==</input></open><open rule="paren-expr" start="4" end="7"><input>(@.d</input></open><open rule="filter-selector" start="3" end="3"><input>?</input></open><open rule="bracketed-selection" start="2" end="2"><input>[</input></open><open rule="jsonpath-query" start="1" end="1"><input>$</input></open></unfinished></failed>
During lazy evaluation of tailCallLoop(ajp:getProcessor(...)) on line 20 of jar:file:./implementations/Java_com.github.xmljacquard.ajp/build/deps/org/xmljacquard/ajp/0.0.7/ajp-0.0.7.jar!/xslt/ajp-runner.xslt
In function ajpr:getProcessor on line 17 column 106 of ajp-runner.xslt:
net.sf.saxon.s9api.SaxonApiException: <failed xmlns:ixml="http://invisiblexml.org/NS" ixml:state="failed"><line>1</line><column>10</column><pos>10</pos><unexpected>{</unexpected><permitted>"'", #9, #A, #D, ' ', '"', '$', '-', '0', '@', 'f', 'n', 't', ['1'-'9'], ['a'-'z']</permitted><completions><completed rule="comparison-op" start="8" end="9"><input>==</input></completed><completed rule="name-segment" start="6" end="7"><input>.d</input></completed><completed rule="child-segment" start="6" end="7"><input>.d</input></completed><completed rule="segment" start="6" end="7"><input>.d</input></completed><completed rule="singular-query-segments" start="6" end="7"><input>.d</input></completed><completed rule="rel-singular-query" start="5" end="7"><input>@.d</input></completed><completed rule="segments" start="6" end="7"><input>.d</input></completed><completed rule="singular-query" start="5" end="7"><input>@.d</input></completed></completions><could-be-next><in rule="DIGIT1"><tokens>['1'-'9']</tokens></in><in rule="current-node-identifier"><tokens>'@'</tokens></in><in rule="int"><tokens>'0'</tokens></in><in rule="root-identifier"><tokens>'$'</tokens></in><in rule="false"><tokens>'f'</tokens></in><in rule="null"><tokens>'n'</tokens></in><in rule="LCALPHA"><tokens>['a'-'z']</tokens></in><in rule="string-literal"><tokens>"'", '"'</tokens></in><in rule="B"><tokens>#9, #A, #D, ' '</tokens></in><in rule="true"><tokens>'t'</tokens></in></could-be-next><unfinished><open rule="comparison-expr" start="5" end="9"><input>@.d==</input></open><open rule="paren-expr" start="4" end="7"><input>(@.d</input></open><open rule="filter-selector" start="3" end="3"><input>?</input></open><open rule="bracketed-selection" start="2" end="2"><input>[</input></open><open rule="jsonpath-query" start="1" end="1"><input>$</input></open></unfinished></failed>

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "d": {
      "k": "v"
    }
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "d": {
      "k": "v"
    }
  }
]

PHP (galbar-jsonpath)

[
  "v"
]

PHP (remorhaz-jsonpath)

Not supported

Error: 'Failed to build AST from JSONPath query: $[?(@.d=={"k":"v"})]'

PHP (softcreatr-jsonpath)

[]

Python (jsonpath) ²

[
  {
    "d": {
      "k": "v"
    }
  }
]

Python (jsonpath-ng)

Not supported

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

Python (jsonpath-rw)

Not supported

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

Python (jsonpath2)

Not supported

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

Python (python-jsonpath)

Not supported

JSONPathSyntaxError("unexpected token '{'")

Raku (JSON-Path)

Not supported

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

Ruby (jsonpath)

[]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

Not supported

path error: 
$[?(@.d=={"k":"v"})]
^^^^^^^^^^^^^

Rust (serde_json_path)

Not supported

at position 3, in long-hand segment, parser error

Scala (jsonpath)

Not supported

JPError(end of input expected)

Swift (Sextant)

[
  {
    "d": {
      "k": "v"
    }
  },
  {
    "d": "{\"k\":\"v\"}"
  }
]

dotNET (Json.NET)

Not supported

Unexpected character while parsing path query: {

dotNET (JsonCons.JsonPath)

[
  {
    "d": {
      "k": "v"
    }
  }
]

dotNET (JsonPath.Net)

[
  {
    "d": {
      "k": "v"
    }
  }
]

dotNET (JsonPathLib)

[
  {
    "d": "[object Object]"
  }
]

dotNET (Manatee.Json)

Not supported

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

Errors

Erlang (ejsonpath)

Timeout

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

unknown token at 5: {"k":"v"} at 4

Golang (github.com-spyzhov-ajson)

wrong request: wrong request: ?(@.d=={"k":"v"})

JavaScript (json-p3)

unexpected filter selector token '{' ('.d=={"k":':9)

JavaScript (jsonpath-plus)

Expected expression after == at character 8

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

Rust (jsonpath_plus)

Error Parsing JSON Path:
$[?(@.d=={"k":"v"})]
panic occurred

Footnotes