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:
4
pkg/yqlib/doc/headers/Collect into Array.md
Normal file
4
pkg/yqlib/doc/headers/Collect into Array.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Collect into Array
|
||||
|
||||
This creates an array using the expression between the square brackets.
|
||||
|
||||
1
pkg/yqlib/doc/headers/Collect into Object.md
Normal file
1
pkg/yqlib/doc/headers/Collect into Object.md
Normal 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.
|
||||
1
pkg/yqlib/doc/headers/Comments Operator.md
Normal file
1
pkg/yqlib/doc/headers/Comments Operator.md
Normal file
@@ -0,0 +1 @@
|
||||
Use these comment operators to set or retrieve comments.
|
||||
1
pkg/yqlib/doc/headers/Delete Operator.md
Normal file
1
pkg/yqlib/doc/headers/Delete Operator.md
Normal file
@@ -0,0 +1 @@
|
||||
Deletes matching entries in maps or arrays.
|
||||
14
pkg/yqlib/doc/headers/Equals Operator.md
Normal file
14
pkg/yqlib/doc/headers/Equals Operator.md
Normal 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)
|
||||
```
|
||||
|
||||
1
pkg/yqlib/doc/headers/Explode Operator.md
Normal file
1
pkg/yqlib/doc/headers/Explode Operator.md
Normal file
@@ -0,0 +1 @@
|
||||
Explodes (or dereferences) aliases and anchors.
|
||||
5
pkg/yqlib/doc/headers/Multiply Operator.md
Normal file
5
pkg/yqlib/doc/headers/Multiply Operator.md
Normal 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.
|
||||
1
pkg/yqlib/doc/headers/Not Operator.md
Normal file
1
pkg/yqlib/doc/headers/Not Operator.md
Normal file
@@ -0,0 +1 @@
|
||||
This is a boolean operator and will return `true` when given a `false` value (including null), and `false` otherwise.
|
||||
5
pkg/yqlib/doc/headers/Recursive Descent Operator.md
Normal file
5
pkg/yqlib/doc/headers/Recursive Descent Operator.md
Normal 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
|
||||
```
|
||||
1
pkg/yqlib/doc/headers/Update Assign Operator.md
Normal file
1
pkg/yqlib/doc/headers/Update Assign Operator.md
Normal 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).
|
||||
Reference in New Issue
Block a user