From 09ad3f2c101b44ba25968571441a656da4d147de Mon Sep 17 00:00:00 2001 From: Abhishek Veeramalla Date: Thu, 26 May 2022 13:40:07 +0530 Subject: [PATCH] Add docs for creating YAML with multiple objects --- .../doc/operators/create-collect-into-object.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/yqlib/doc/operators/create-collect-into-object.md b/pkg/yqlib/doc/operators/create-collect-into-object.md index b90866c9..12802ba5 100644 --- a/pkg/yqlib/doc/operators/create-collect-into-object.md +++ b/pkg/yqlib/doc/operators/create-collect-into-object.md @@ -86,3 +86,16 @@ will output wrap: frog ``` +## Creating yaml from scratch with multiple objects +Running +```bash +yq --null-input '(.a.b = "foo") | (.d.e = "bar")' +``` +will output +```yaml +a: + b: foo +d: + e: bar +``` +