Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluating JsonPath on a Reader #55

Closed
austinarbor opened this issue May 27, 2021 · 1 comment
Closed

Evaluating JsonPath on a Reader #55

austinarbor opened this issue May 27, 2021 · 1 comment

Comments

@austinarbor
Copy link

austinarbor commented May 27, 2021

I didn't see anything mentioned in the documentation, but is it possible to evaluate the json path on a reader, or can you only evaluate the path on a byte array/string? I took a look at the cli code and it looks like the whole file must be read into memory first before it evaluates the expression on it. Is there any way around this?

Thanks

@ohler55
Copy link
Owner

ohler55 commented May 29, 2021

JSON path (jp) can only be used on a data that is in memory and not on a reader. If you are loading a log file or any file that has multiple JSON objects in it then it is possible to evaluate the JSON path against each as it is loaded. I use that quite often with the oj command when dealing with multiple GB files composed of multiple JSON elements.

@ohler55 ohler55 closed this as completed Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants