Skip to content

Slice Selector for reversing the Output  #176

Open
@MarkusMas

Description

@MarkusMas

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions