Equivalent of yq --collect --tojson
?
#128
Replies: 2 comments 5 replies
-
This isn't possible right now but is a fairly simple use-case. I'll add a echo 'foo: bar
---
baz: biz' | dasel -r yaml -w json --merge-input-documents .
[
{
"foo": "bar"
},
{
"baz": "biz"
}
]
The work is done on the go install github.com/tomwright/dasel/cmd/dasel@merge-documents The documentation is here: https://app.gitbook.com/@tomwright/s/dasel/usage/flags/merge-input-documents |
Beta Was this translation helpful? Give feedback.
-
Take note that merge in this case means taking all of the input documents and adding them to a single array of those documents. Input: Where: Output: [
{"number": 1},
{"number": 2},
{"number": 3}
] The use of "merge" here could be mistaken in that you may expect the following output: {
"number": 3
} I'm considering adding a new feature that will provide the second output but am not yet sure what the usage will look like. |
Beta Was this translation helpful? Give feedback.
-
Given a yaml file that has multiple documents, e.g.
I'd like to get an array of each document. Is this possible with dasel?
Beta Was this translation helpful? Give feedback.
All reactions