Results 161 comments of Mike Farah

Hmm not sure why that's not working, need to look into it. As a workaround, if you run explode first then it works: ``` yq 'explode(.) | .aaa[2]' aaa.yaml ```

This is actually intentional when using variables - despite how odd it looks. The expression ". as $all | ..." is actually like a for loop (this is how jq...

Yeah this is what the underlying yaml library does - I believe there is already a bug raised against it - but that library isn't getting much love atm. I...

That right, it overwrites the values. You cannot have two keys with the same value in a map. Another way to think of it is merging two maps, one: ```...

I'm not quite sure what you are trying to do - but perhaps you are getting confused with `eval` and `env` - eval is passed an expression string (e.g. ".a.b.c")...

This was more complicated than I though. The short answer to your question is that you can use a create a variable to reference the root `. as $r` -...

This is because yq works a little differently than jq - for better or worse. You can get the right result by using a variable to force it to first...

Not documented anywhere atm. Basically what `yq` is doing under the hood is looping through each LHS, evaluating the RHS (.referenced) and assigning the result. The issue is, after .referenced...

Yep - yq intentionally leaves as much of the document comments untouched (this was done from a bunch of issues people raised where it would mess up their nicely formatted...

yq uses https://github.com/magiconair/properties to decode/encode property files and it currently does not expose an interface to let me control the whitespace. For now, you could do a custom format, I've...