Filter expression with multiplication

Setup

Selector: $[?(@.key*2==100)]

[{"key": 60}, {"key": 50}, {"key": 10}, {"key": -50}, {"key*2": 100}]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(@.key*2==100)]': Invalid array index definition “?(@.key*2==100)]”

Clojure (json-path) ¹

[
  {
    "key": 60
  },
  {
    "key": 50
  },
  {
    "key": 10
  },
  {
    "key": -50
  },
  {
    "key*2": 100
  }
]

Cpp (jsoncons)

[
  {
    "key": 50
  }
]

Dart (json_path)

Not supported

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

Elixir (ExJsonPath)

Not supported

syntax error before: '*'

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

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

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(@.key*2==100)]	:1:10 - 1:11 unexpected "*" while scanning parentheses expected ")"

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

[
  {
    "key": 50
  }
]

Golang (github.com-ohler55-ojg)

Not supported

Golang (github.com-oliveagle-jsonpath) ¹

[]

Golang (github.com-spyzhov-ajson)

[
  {
    "key*2": 100
  }
]

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

[
  {
    "key*2": 100
  }
]

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(@.key*2==100)]
 Error: 1:10:
  |
1 | $[?(@.key*2==100)]
  |          ^
unexpected '*'
expecting "!=", "&&", "<=", "==", ">=", "||", '!', ')', '.', '<', '>', '[', or white space

JavaScript (Goessner) ²

[
  {
    "key": 50
  }
]

JavaScript (brunerd)

[
  {
    "key": 50
  }
]

JavaScript (jsonpath)

[
  {
    "key": 50
  }
]

JavaScript (jsonpath-plus)

[
  {
    "key": 50
  }
]

JavaScript (jsonpathly)

[
  {
    "key": 50
  }
]

Java (com.github.jsurfer)

Not supported

org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "key*2": 100
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "key*2": 100
  }
]

PHP (galbar-jsonpath)

Not supported

Invalid JSONPath error: 'Error in JSONPath near '*2''

PHP (remorhaz-jsonpath)

Not supported

Error: 'Failed to build AST from JSONPath query: $[?(@.key*2==100)]'

PHP (softcreatr-jsonpath)

[
  {
    "key*2": 100
  }
]

Python (jsonpath) ²

[
  {
    "key": 50
  }
]

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:9 mismatched input '*' expecting ')'
ValueError("line 1:9 mismatched input '*' expecting ')'")

Python (python-jsonpath)

Not supported

JSONPathSyntaxError("expected ('FILTER_END', 'RBRACKET'), found 'INT'")

Raku (JSON-Path)

Not supported

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

Ruby (jsonpath)

[
  {
    "key": 60
  },
  {
    "key": 50
  },
  {
    "key": 10
  },
  {
    "key": -50
  }
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

Not supported

path error: 
$[?(@.key*2==100)]
^^^^^^^^^^

Rust (jsonpath_plus)

[]

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)

[
  {
    "key*2": 100
  }
]

dotNET (Json.NET)

[
  {
    "key*2": 100
  }
]

dotNET (JsonCons.JsonPath)

[
  {
    "key": 50
  }
]

dotNET (JsonPath.Net)

[
  {
    "key": 50
  }
]

dotNET (JsonPathLib)

[
  {
    "key": 50
  }
]

dotNET (Manatee.Json)

[
  {
    "key": 50
  }
]

Errors

Erlang (ejsonpath)

init terminating in do_boot ({not_implemented,bin_op,*})

Crash dump is being written to: /dev/null...done
{"init terminating in do_boot",{not_implemented,bin_op,'*'}}

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

Footnotes