How to use the JsonPath functions like min()

1,659 views
Skip to first unread message

Charles Shen

unread,
Mar 1, 2016, 4:01:48 AM3/1/16
to JsonPath
hi,
I am trying to find out how the use the functions min()/max()/avg()/stddev()/length()

expressions : 
$..book..price.min()

geing below exception:

Exception in thread "main" class net.minidev.json.JSONArray
[null,null,null,null]
java
.lang.NullPointerException

can you please help provide some example code? cause the examples in github page dont cover this.

kalle stenflo

unread,
Mar 1, 2016, 6:49:26 AM3/1/16
to json...@googlegroups.com
Hi,

In current implementation the function is applied to the path fragment just before the function. In your example the min() function is applied to each price. Not as you might expect to the result array containing all prices. The feature you are looking for is not available (yet).   

Check out the function tests fore more details



--
You received this message because you are subscribed to the Google Groups "JsonPath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonpath+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yavuz Gökırmak

unread,
Jun 7, 2016, 6:20:00 AM6/7/16
to JsonPath
Hi Stenflo,

I need this feature and can contribute,

where should I start, should I create an issue and ask for comments from you?
Reply all
Reply to author
Forward
0 new messages