Filter expression with in current object

Setup

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

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

Results

Consensus

Not supported

Other responses

Bash (JSONPath.sh)

[]

Clojure (json-path) ¹

[]

Elixir (jaxon)

[]

Golang (github.com-ohler55-ojg)

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

Golang (github.com-oliveagle-jsonpath) ¹

[]

JavaScript (Goessner) ²

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

JavaScript (brunerd)

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

JavaScript (jsonpath)

[]

JavaScript (jsonpath-plus)

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

Java (com.jayway.jsonpath) ¹ ³

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

Objective-C (SMJJSONPath) ¹ ³

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

PHP (galbar-jsonpath) ²

Not found

jsonpath returned false, this might indicate an error

Python (jsonpath) ²

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

Ruby (jsonpath)

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

Swift (Sextant)

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

dotNET (JsonPathLib)

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

Errors

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

not enough arguments

Golang (github.com-spyzhov-ajson)

wrong request: wrong request: ?(2 in @.d)

PHP (Goessner) ²

ArgumentCountError

PHP (softcreatr-jsonpath)

Error: 'Malformed filter query'

Perl (JSON-Path)

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

Rust (jsonpath_plus)

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

Footnotes