Filter expression with value true

Setup

Selector: $[?(true)]

[1, 3, "nice", true, null, false, {}, [], -1, 0, ""]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(true)]': Invalid array index definition “?(true)]”

Clojure (json-path) ¹

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Cpp (jsoncons)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Dart (json_path)

Not supported

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

Elixir (ExJsonPath)

Not supported

syntax error before: <<"true">>

Elixir (jaxon)

[]

Elixir (warpath) ¹

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Erlang (ejsonpath)

Not supported

syntax error before: ')'

Golang (github.com-PaesslerAG-jsonpath) ¹

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

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

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Golang (github.com-ohler55-ojg)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Golang (github.com-oliveagle-jsonpath) ¹

[
  []
]

Golang (github.com-spyzhov-ajson)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

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

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(true)]
 Error: 1:9:
  |
1 | $[?(true)]
  |         ^^
unexpected ")]"
expecting "!=", "<=", "==", ">=", '!', '<', '>', or white space

JavaScript (Goessner) ²

[
  1,
  3,
  "nice",
  true,
  {},
  [],
  -1
]

JavaScript (brunerd)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

JavaScript (jsonpath)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

JavaScript (jsonpath-plus)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

JavaScript (jsonpathly)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Java (com.github.jsurfer)

Not supported

line 1:4 no viable alternative at input 'true'
org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

Not supported

SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
com.jayway.jsonpath.InvalidPathException: Expected path node

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

Not supported

path node expected

PHP (galbar-jsonpath)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  [],
  [],
  -1,
  0,
  ""
]

PHP (remorhaz-jsonpath)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

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)

[
  [
    1,
    3,
    "nice",
    true,
    null,
    false,
    {},
    [],
    -1,
    0,
    ""
  ]
]

Python (python-jsonpath)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Raku (JSON-Path)

Not supported

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

Ruby (jsonpath)

[
  1,
  3,
  "nice",
  true,
  {},
  [],
  -1,
  0,
  ""
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

Not supported

path error: 
$[?(true)]
^^^^^^^^

Rust (jsonpath_plus)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Rust (serde_json_path)

Not supported

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

Scala (jsonpath)

Not supported

JPError(end of input expected)

Swift (Sextant)

Not supported

NOT_SUPPORTED

dotNET (Json.NET)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

dotNET (JsonCons.JsonPath)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

dotNET (JsonPath.Net)

Not supported

Pattern '(true)]' not recognized.

dotNET (JsonPathLib)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

dotNET (Manatee.Json)

[
  1,
  3,
  "nice",
  true,
  null,
  false,
  {},
  [],
  -1,
  0,
  ""
]

Errors

PHP (Goessner) ²

ArgumentCountError

PHP (softcreatr-jsonpath)

Error: 'Malformed filter query'

Perl (JSON-Path)

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

Footnotes