-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
More examples #171
Comments
The issue here is that dasel expects each item within the I can update the dynamic selector to be able to handle type checks. Let me work on a quick POC for this to validate the use-case and solution. |
The customisation I'm working on will give you the ability to do the following:
In English this means,
As an aside, if you just want to find any item anywhere within your file that has a key of
|
Another example:
It searches for a plugin item that is an array where the first item in the array is equal to |
I'm going to do a bit more testing on my branch and then I'll merge. This will likely go out in the next release. |
Gave this a try locally, and works wonders, thanks for the improvements! |
This is merged to master now but is not in a tagged release yet. It will be going out in the next release though 👍 |
This is released as of |
I've tried to upgrade this one to v2, and came up with the following monstrosity: dasel -f .releaserc -r json ".plugins.all().filter(equal(type(),array)).[1].as
sets" It makes some assumptions on the structure, such as the order in the nested array, but my main question is, can it be written more concise? |
I can't say this is much nicer, but it will at-least work if the ordering is changed around:
|
Excellent, thank you! It's working wonders. I've also seen your comment in #352, and I'm using this for an Thanks again! |
When trying to select from more complex files, I'm at a loss on what's possible, and keep failing at creating a proper query.
Take the following yaml:
I would like to retrieve the list under assets. How would I write a query to achieve this?
Some more examples of all the selector features in the documenation would probably help achieve this.
When converted to json, I can get it using
dasel -f .releaserc -r json '.plugins.[3].[1].assets'
, but that would require a consistent ordering, which isn't guaranteed.The text was updated successfully, but these errors were encountered: