Filter expression with single equal

Setup

Selector: $[?(@.key=42)]

[
    {"key": 0},
    {"key": 42},
    {"key": -1},
    {"key": 1},
    {"key": 41},
    {"key": 43},
    {"key": 42.0001},
    {"key": 41.9999},
    {"key": 100},
    {"key": "some"},
    {"key": "42"},
    {"key": null},
    {"key": 420},
    {"key": ""},
    {"key": {}},
    {"key": []},
    {"key": [42]},
    {"key": {"key": 42}},
    {"key": {"some": 42}},
    {"some": "value"}
]

Results

Consensus

Not supported

Other responses

Bash (JSONPath.sh)

[
  42,
  "42"
]

Clojure (json-path) ¹

[
  {
    "key": 42
  }
]

Elixir (jaxon)

[]

Golang (github.com-oliveagle-jsonpath) ¹

[]

JavaScript (Goessner) ²

[
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42,
    "some": "value"
  }
]

JavaScript (jsonpath)

[]

JavaScript (jsonpath-plus)

[
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42
  },
  {
    "key": 42,
    "some": "value"
  }
]

PHP (softcreatr-jsonpath)

[
  {
    "key": 42
  },
  {
    "key": "42"
  }
]

Python (jsonpath) ²

Not found

jsonpath returned false, this might indicate an error

Python (jsonpath2)

[]

dotNET (JsonPathLib)

[
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0
  },
  {
    "key": 42.0,
    "some": "value"
  }
]

Errors

Erlang (ejsonpath)

Timeout

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

unknown token at 5: =42 at 4

Golang (github.com-spyzhov-ajson)

wrong symbol '=' at 7

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

Ruby (jsonpath)

undefined method `=' for 0.0:Float
Did you mean?  =~
               ==

Rust (jsonpath_plus)

Error Parsing JSON Path:
$[?(@.key=42)]
panic occurred

Footnotes