-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
recurse()
, but preserve structure
#263
Comments
@1ace You want to remove keys that are not of interest, is that it? |
I was lurking through the In order to remove the "foo" attribute from each element of the structure, you want to recurse through the structure and set each element to the result of deleting the
If, instead of blacklisting
|
@slapresta That's a neat idiom we should add to the wiki. Thanks! |
I think we can close this, but I don't have permission to do so. |
I left it open because I haven't checked whether the wiki mentions this, and it's worth making sure it does. |
The idioms are described at |
Thanks :) |
Let's take the
recurse
example from the manual, and add a bunch of useless{"foo": "bar"}
to it:recurse(.children[]) | .name
will give me all thename
s, but destroy the structure of the JSON in the process.Is there a way to get that information, but preserve the structure?
With the JSON above, this would be the output:
The text was updated successfully, but these errors were encountered: