Function sum
Setup
Selector: $.data.sum()
{"data": [1,2,3,4]}
Results
Consensus
Not supported
Other responses
Bash (JSONPath.sh)
[]
C (json-glib)
[]
Clojure (json-path)
¹
null
Elixir (jaxon)
[]
[]
[]
JavaScript (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
JavaScript (jsonpath-plus)
[]
Java (com.jayway.jsonpath)
¹
³
10.0
Kotlin (com.nfeld.jsonpathkt)
¹
null
Objective-C (SMJJSONPath)
¹
³
10
PHP (Goessner)
²
Not found
jsonpath returned false, this might indicate an error
PHP (galbar-jsonpath)
[]
Perl (JSON-Path)
[]
Python (jsonpath)
²
Not found
jsonpath returned false, this might indicate an error
Ruby (jsonpath)
[]
Rust (jsonpath_lib)
[]
Swift (Sextant)
[
10
]
dotNET (JsonPathLib)
[]
Errors
path: unknown function at 10
PHP (remorhaz-jsonpath)
Error: 'Failed to execute JSONPath query: $.data.sum()
$var2 = $matcherFactory->matchPropertyStrictly('data');
$var3 = $valueListFetcher->fetchChildren($input, $var2);
$var4 = $evaluator->aggregate('sum', $var3);
return $var4;'
Rust (jsonpath_plus)
Error Parsing JSON Path:
$.data.sum()
panic occurred
Footnotes
- ¹ This implementation returns a single value where only one match is possible (instead of an array of a single value).
- ² This implementation returns a specific not found value if no match exists.
- ³ This implementation returns a specific not found value if a query that would regularly return a single match results in no match.