Filter expression with negation and less than

Setup

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

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

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(!(@.key<42))]': Invalid array index definition “?(!(@.key<42))]”

Clojure (json-path) ¹

[]

Cpp (jsoncons)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Dart (json_path)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Elixir (ExJsonPath)

Not supported

illegal characters "!("

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

Invalid syntax on line 1, {:illegal, '!('}

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(!(@.key<42))]	:1:5 - 1:6 unexpected "!" while scanning extensions

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

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Golang (github.com-ohler55-ojg)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Golang (github.com-oliveagle-jsonpath) ¹

[]

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

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Haskell (jsonpath)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

JavaScript (Goessner) ²

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

JavaScript (brunerd)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

JavaScript (jsonpath)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

JavaScript (jsonpath-plus)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

JavaScript (jsonpathly)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Java (com.github.jsurfer)

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

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  }
]

PHP (galbar-jsonpath)

[]

PHP (remorhaz-jsonpath)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  }
]

Python (jsonpath) ²

Not found

jsonpath returned false, this might indicate an error

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:4 token recognition error at: '!('
ValueError("line 1:4 token recognition error at: '!('")

Python (python-jsonpath)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Raku (JSON-Path)

Not supported

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

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

Not supported

path error: 
$[?(!(@.key<42))]
^^^^

Rust (jsonpath_plus)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  }
]

Rust (serde_json_path)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

Scala (jsonpath)

Not supported

JPError(end of input expected)

Swift (Sextant)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  }
]

dotNET (Json.NET)

Not supported

Unexpected character while parsing path query: !

dotNET (JsonCons.JsonPath)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

dotNET (JsonPath.Net)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "41"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

dotNET (JsonPathLib)

[
  {
    "key": 42
  },
  {
    "key": 43
  },
  {
    "key": 42.0001
  },
  {
    "key": 100
  },
  {
    "key": "43"
  },
  {
    "key": "42"
  },
  {
    "key": "value"
  },
  {
    "some": "value"
  }
]

dotNET (Manatee.Json)

[
  {
    "key": 0
  },
  {
    "key": -1
  },
  {
    "key": 41
  },
  {
    "key": 41.9999
  }
]

Errors

Erlang (ejsonpath)

Timeout

Golang (github.com-spyzhov-ajson)

wrong symbol '!' at 2

PHP (Goessner) ²

ArgumentCountError

PHP (softcreatr-jsonpath)

Error: 'Malformed filter query'

Perl (JSON-Path)

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

Ruby (jsonpath)

wrong number of arguments (given 1, expected 0)

Footnotes