Filter expression with in array of values

Setup

Selector: $[?(@.d in [2, 3])]

[{"d": 1}, {"d": 2}, {"d": 1}, {"d": 3}, {"d": 4}]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

Unable to compile selector `$[?(@.d in [2, 3])]': Invalid array index definition “?(@.d in [2, 3])]”

Cpp (jsoncons)

Not supported

Expected dot or left bracket separator at line 1 and column 9

Dart (json_path)

Not supported

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

Elixir (ExJsonPath)

Not supported

syntax error before: <<"in">>

Elixir (jaxon)

[]

Elixir (warpath) ¹

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

Erlang (ejsonpath)

Not supported

syntax error before: <<"in">>

Golang (github.com-PaesslerAG-jsonpath) ¹

Not supported

parsing error: $[?(@.d in [2, 3])]	:1:9 - 1:11 unexpected Ident while scanning parentheses expected ")"

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

[]

Golang (github.com-ohler55-ojg)

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

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

Not supported

invalid filter expression at position 8, following ".d "

Haskell (jsonpath)

Not supported

Invalid JSONPath: $[?(@.d in [2, 3])]
 Error: 1:9:
  |
1 | $[?(@.d in [2, 3])]
  |         ^^
unexpected "in"
expecting "!=", "&&", "<=", "==", ">=", "||", '!', ')', '<', '>', or white space

JavaScript (Goessner) ²

[
  {
    "d": 1
  },
  {
    "d": 1
  }
]

JavaScript (brunerd)

[
  {
    "d": 1
  },
  {
    "d": 2
  },
  {
    "d": 1
  },
  {
    "d": 3
  },
  {
    "d": 4
  }
]

JavaScript (jsonpath)

[]

JavaScript (jsonpath-plus)

[
  {
    "d": 1
  },
  {
    "d": 1
  }
]

JavaScript (jsonpathly)

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

Java (com.github.jsurfer)

Not supported

org.antlr.v4.runtime.misc.ParseCancellationException

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

PHP (galbar-jsonpath)

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

PHP (remorhaz-jsonpath)

Not supported

Error: 'Failed to build AST from JSONPath query: $[?(@.d in [2, 3])]'

PHP (softcreatr-jsonpath)

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

Python (jsonpath) ²

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

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

Python (python-jsonpath)

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

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: 
$[?(@.d in [2, 3])]
^^^^^^^^^^

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": 2
  },
  {
    "d": 3
  }
]

dotNET (Json.NET)

Not supported

Could not read query operator.

dotNET (JsonCons.JsonPath)

Not supported

Syntax error

dotNET (JsonPath.Net)

[
  {
    "d": 2
  },
  {
    "d": 3
  }
]

dotNET (JsonPathLib)

[
  {
    "d": 1
  },
  {
    "d": 1
  }
]

dotNET (Manatee.Json)

Not supported

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

Errors

Clojure (json-path) ¹

java.lang.Exception object must be an array.

Golang (github.com-oliveagle-jsonpath) ¹

interface conversion: interface {} is nil, not string

Golang (github.com-spyzhov-ajson)

wrong request: wrong request: ?(@.d in [2, 3])

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

Ruby (jsonpath)

invalid value for Integer(): " 3])"

Rust (jsonpath_plus)

Error Parsing JSON Path:
$[?(@.d in [2, 3])]
panic occurred

Footnotes