ohler55 / ojg

Optimized JSON for Go
MIT License
857 stars 49 forks source link

Provides the length functionality #137

Closed ayadav111 closed 1 year ago

ayadav111 commented 1 year ago

Hi,

I am using your library for JSON path filter and I wanted to use length functionality sothat it can provides the length of an array in a given JSON but I couldn't find out.

length() | Provides the length of an array | Integer -- | -- | --

Jayway jsonpath is having this functionality. ref: https://github.com/json-path/JsonPath Can we have the same here ? Thank you!

ohler55 commented 1 year ago

Please re-check the documentation https://pkg.go.dev/github.com/ohler55/ojg/jp#Script. The length function is supported in OjG. You can construct a script directly or length(@.x) can be used in a filter expression.

ohler55 commented 1 year ago

Can this be closed?