From 27a14ec188ec61eb33faaf800c48054b14496f72 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Fri, 29 Apr 2022 12:16:48 +1000 Subject: [PATCH] v4.25.1 --- operators/tag.md | 23 +++++++++++++++++++++++ operators/unique.md | 6 ++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/operators/tag.md b/operators/tag.md index 31bc4643..33e11f65 100644 --- a/operators/tag.md +++ b/operators/tag.md @@ -31,6 +31,29 @@ will output !!seq ``` +## type is an alias for tag +Given a sample.yml file of: +```yaml +a: cat +b: 5 +c: 3.2 +e: true +f: [] +``` +then +```bash +yq '.. | type' sample.yml +``` +will output +```yaml +!!map +!!str +!!int +!!float +!!bool +!!seq +``` + ## Set custom tag Given a sample.yml file of: ```yaml diff --git a/operators/unique.md b/operators/unique.md index af33321c..9ea330f6 100644 --- a/operators/unique.md +++ b/operators/unique.md @@ -9,10 +9,12 @@ Note that versions prior to 4.18 require the 'eval/e' command to be specified.&# {% endhint %} ## Unique array of scalars (string/numbers) +Note that unique maintains the original order of the array. + Given a sample.yml file of: ```yaml -- 1 - 2 +- 1 - 3 - 2 ``` @@ -22,8 +24,8 @@ yq 'unique' sample.yml ``` will output ```yaml -- 1 - 2 +- 1 - 3 ```