Filter expression with non singular existence test

Setup

Selector: $[?(@.a.*)]

[
    {"a": 0},
    {"a": "x"},
    {"a": false},
    {"a": true},
    {"a": null},
    {"a": []},
    {"a": [1]},
    {"a": [1, 2]},
    {"a": {}},
    {"a": {"x": "y"}},
    {"a": {"x": "y", "w": "z"}}
]

Results

Other responses

Bash (JSONPath.sh)

[]

C (json-glib)

Not supported

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

Clojure (json-path) ¹

[]

Cpp (jsoncons)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Dart (json_path)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Elixir (ExJsonPath)

Not supported

syntax error before: ')'

Elixir (jaxon)

[]

Elixir (warpath) ¹

Not supported

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

Erlang (ejsonpath)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Golang (github.com-PaesslerAG-jsonpath) ¹

[]

Golang (github.com-ohler55-ojg)

[]

Golang (github.com-oliveagle-jsonpath) ¹

[]

Golang (github.com-spyzhov-ajson)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

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

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Haskell (jsonpath)

Not supported

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

JavaScript (brunerd)

Not supported

JavaScript (jsonpathly)

[
  {
    "a": 0
  },
  {
    "a": "x"
  },
  {
    "a": false
  },
  {
    "a": true
  },
  {
    "a": null
  },
  {
    "a": []
  },
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {}
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Java (com.github.jsurfer)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Java (com.jayway.jsonpath) ¹ ³

[
  {
    "a": 0
  },
  {
    "a": "x"
  },
  {
    "a": false
  },
  {
    "a": true
  },
  {
    "a": null
  },
  {
    "a": []
  },
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {}
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Kotlin (com.nfeld.jsonpathkt) ¹

Not supported

Unexpected char, char=?, index=2

Objective-C (SMJJSONPath) ¹ ³

[
  {
    "a": 0
  },
  {
    "a": "x"
  },
  {
    "a": false
  },
  {
    "a": true
  },
  {
    "a": null
  },
  {
    "a": []
  },
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {}
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

PHP (galbar-jsonpath)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

PHP (remorhaz-jsonpath)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

PHP (softcreatr-jsonpath)

[]

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)

[]

Python (python-jsonpath)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Raku (JSON-Path)

Not supported

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

Ruby (jsonpath)

[
  {
    "a": 0
  },
  {
    "a": "x"
  },
  {
    "a": true
  },
  {
    "a": []
  },
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {}
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Rust (jsonpath)

Not supported

parsing error

Rust (jsonpath_lib)

[
  {
    "a": 0
  },
  {
    "a": "x"
  },
  {
    "a": false
  },
  {
    "a": true
  },
  {
    "a": null
  },
  {
    "a": []
  },
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {}
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Rust (jsonpath_plus)

[]

Rust (serde_json_path)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Scala (jsonpath)

[
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

Swift (Sextant)

[
  {
    "a": 0
  },
  {
    "a": "x"
  },
  {
    "a": false
  },
  {
    "a": true
  },
  {
    "a": null
  },
  {
    "a": []
  },
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {}
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

dotNET (Json.NET)

[
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

dotNET (JsonCons.JsonPath)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

dotNET (JsonPath.Net)

[
  {
    "a": [
      1
    ]
  },
  {
    "a": [
      1,
      2
    ]
  },
  {
    "a": {
      "x": "y"
    }
  },
  {
    "a": {
      "w": "z",
      "x": "y"
    }
  }
]

dotNET (Manatee.Json)

Not supported

The method or operation is not implemented.

Errors

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

path: unexpected end of path at 4

JavaScript (Goessner) ²

jsonPath: Unexpected token *: _v.a.*

JavaScript (jsonpath)

Line 1: Unexpected token *

JavaScript (jsonpath-plus)

Unexpected token '*'

PHP (Goessner) ²

ArgumentCountError

Perl (JSON-Path)

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

dotNET (JsonPathLib)

Line 1: Unexpected token *

Footnotes