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

Advanced path string syntax for slicing #2

Open
bauerca opened this issue Dec 19, 2014 · 0 comments
Open

Advanced path string syntax for slicing #2

bauerca opened this issue Dec 19, 2014 · 0 comments

Comments

@bauerca
Copy link
Owner

bauerca commented Dec 19, 2014

Currently, only one value can be extracted from a JSON stream; for example, fetching 2 values from a large array requires two stream passes. A JSON path string syntax for complex slicing would allow extracting multiple values from a single stream.

Some things to consider:

  • Output order must match order in stream. (requesting, for example, [arr[1], arr[0]] is impossible)
  • Other things. :)

An enhanced path string could basically be JSON where values are path strings. For example:

{"dogs": dogs[0:3], "cat_breeds": cats[:].breed}

where the example also introduces an array slicing syntax similar to python and a map function that allows picking attributes over an array of objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant