Closed Skeeve closed 3 months ago
That is expected behavior. If you want to not just remove a value but also collapse the array to fill in the removed item the jp.MustModify()
is the function you are looking for.
And what about jp.Remove()
?
Ah yes, jp.Remove()
also works. Probably easier in this case too.
Are there any examples for MustModify
? I find the documentation a bit confusing for someone who just discovered JSONPath.
Also there are some typos. pinic
instead of panic
for example.
There are unit tests for all the functions in the same directory as the code (ojg/jp). That probably the best place to start.
There are some links to the JSONPath spec in the README.md although that can get pretty overwhelming.
The docs for jp.MustModify
were updated in develop if you would like to check it out.
Okay to close this?
I wasn't able to check the docs, but fine with me.
I would have expected the output to be:
But instead it is
Is this a misunderstanding on my part or a bug?