We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is it possible to write a filter that checks all the key names and filter out those with specific names. For example, if the input is
{ "id": 1, "name": "n1", "_parent": 0, "children" : [ { "id": 11, "name": "n11", "_parent": 1, "children": [ { "id": 111, "name": "n111", "_parent": 11 } ] } ] }
I want the output not to have "_parent" attribute. So, the output should be:
{ "id": 1, "name": "n1", "children" : [ { "id": 11, "name": "n11", "children": [ { "id": 111, "name": "n111", } ] } ] }
Doing the following is not working.
String filter = " .key != \"_parent\" "; StringReader jslt = new StringReader("."); Expression expr = new Parser(jslt).withObjectFilter(filter).compile(); return expr.apply(resultObj);
The text was updated successfully, but these errors were encountered:
You can write a function which goes through the values recursively, and use
{for (.) .key : .value if (.key != "_parent")}
to do the filtering at each step.
Sorry, something went wrong.
No branches or pull requests
Is it possible to write a filter that checks all the key names and filter out those with specific names.
For example, if the input is
I want the output not to have "_parent" attribute. So, the output should be:
Doing the following is not working.
The text was updated successfully, but these errors were encountered: