1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

include docs for tracking

This commit is contained in:
Mike Farah
2020-11-18 09:44:16 +11:00
parent 83cb6421df
commit 088ec36acd
23 changed files with 1115 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
# Collect into Array
This creates an array using the expression between the square brackets.

View File

@@ -0,0 +1 @@
This is used to construct objects (or maps). This can be used against existing yaml, or to create fresh yaml documents.

View File

@@ -0,0 +1 @@
Use these comment operators to set or retrieve comments.

View File

@@ -0,0 +1 @@
Deletes matching entries in maps or arrays.

View File

@@ -0,0 +1,14 @@
## Equals Operator
This is a boolean operator that will return ```true``` if the LHS is equal to the RHS and ``false`` otherwise.
```
.a == .b
```
It is most often used with the select operator to find particular nodes:
```
select(.a == .b)
```

View File

@@ -0,0 +1 @@
Explodes (or dereferences) aliases and anchors.

View File

@@ -0,0 +1,5 @@
Like the multiple operator in `jq`, depending on the operands, this multiply operator will do different things. Currently only objects are supported, which have the effect of merging the RHS into the LHS.
Upcoming versions of `yq` will add support for other types of multiplication (numbers, strings).
Note that when merging objects, this operator returns the merged object (not the parent). This will be clearer in the examples below.

View File

@@ -0,0 +1 @@
This is a boolean operator and will return `true` when given a `false` value (including null), and `false` otherwise.

View File

@@ -0,0 +1,5 @@
This operator recursively matches all children nodes given of a particular element, including that node itself. This is most often used to apply a filter recursively against all matches, for instance to set the `style` of all nodes in a yaml doc:
```bash
yq eval '.. style= "flow"' file.yaml
```

View File

@@ -0,0 +1 @@
Updates the LHS using the expression on the RHS. Note that the RHS runs against the _original_ LHS value, so that you can evaluate a new value based on the old (e.g. increment).