diff --git a/README.md b/README.md index 55b311cd..57166f13 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,22 @@ Operators | `[start:end]` | Array slice operator | | `[?()]` | Filter expression. Expression must evaluate to a boolean value. | + +Functions +--------- + +Functions can be invoked at the tail end of a path - the input to a function is the output of the path expression. +The function output is dictated by the function itself. + +| Function | Description | Output | +| :------------------------ | :----------------------------------------------------------------- |-----------| +| %min() | Provides the min value of an array of numbers | Double | +| %max() | Provides the max value of an array of numbers | Double | +| %avg() | Provides the average value of an array of numbers | Double | +| %stddev() | Provides the standard deviation value of an array of numbers | Double | +| %length() | Provides the length of an array | Integer | + + Path Examples ------------- @@ -124,7 +140,7 @@ Given the json | $..book[?(@.price <= $['expensive'])] | All books in store that are not "expensive" | | $..book[?(@.author =~ /.*REES/i)] | All books matching regex (ignore case) | | $..* | Give me every thing | - +| $..book.%length() | The number of books | Reading a Document ------------------