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

Slice Selector for reversing the Output #176

Open
MarkusMas opened this issue Jul 20, 2022 · 0 comments
Open

Slice Selector for reversing the Output #176

MarkusMas opened this issue Jul 20, 2022 · 0 comments
Labels

Comments

@MarkusMas
Copy link

Many JsonPath methods like dchester and goessner feature reversing the output with the slice selector. For example:

Example Description
$[-1] Last item
$[-2:] Last two items
$[:-2] All items except the last two
$[::-1] All items, reversed
$[1::-1] First two items, reversed
$[:-3:-1] Last two items, reversed
$[-3::-1] All items except the last two, reversed

Source: https://danielaparker.github.io/JsonCons.Net/articles/JsonPath/JsonConsJsonPath.html

The slicing works great with JSONPath-Plus however reversing (with -1 at the end) seems to be unavailable.

Is it possible to add this feature. Or is there any othe workaroud. Maybe a different expression that is not documented?

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

No branches or pull requests

1 participant