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

Fixing docs

This commit is contained in:
Mike Farah
2020-11-22 13:16:54 +11:00
parent e9fa873af8
commit aed598c736
64 changed files with 414 additions and 543 deletions

View File

@@ -1 +1 @@
The `or` and `and` operators take two parameters and return a boolean result. These are most commonly used with the `select` operator to filter particular nodes.
The `or` and `and` operators take two parameters and return a boolean result. `not` flips a boolean from true to false, or vice versa. These are most commonly used with the `select` operator to filter particular nodes.

View File

@@ -0,0 +1 @@
Use the `documentIndex` operator to select nodes of a particular document.

View File

@@ -1,5 +1,3 @@
## Equals Operator
This is a boolean operator that will return ```true``` if the LHS is equal to the RHS and ``false`` otherwise.
```

View File

@@ -1,5 +1,7 @@
File operators are most often used with merge when needing to merge specific files together. Note that when doing this, you will need to use `eval-all` to ensure all yaml documents are loaded into memory before performing the merge (as opposed to `eval` which runs the expression once per document).
## Merging files
Note the use of eval-all to ensure all documents are loaded into memory.
```bash
yq eval-all 'select(fileIndex == 0) * select(filename == "file2.yaml")' file1.yaml file2.yaml
```

View File

@@ -2,4 +2,11 @@ Like the multiple operator in `jq`, depending on the operands, this multiply ope
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.
Note that when merging objects, this operator returns the merged object (not the parent). This will be clearer in the examples below.
## Merging files
Note the use of eval-all to ensure all documents are loaded into memory.
```bash
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' file1.yaml file2.yaml
```

View File

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

View File

@@ -1 +0,0 @@
The path operator can be used to find the traversal paths of matching nodes in an expression. The path is returned as an array, which if traversed in order will lead to the matching node.

View File

@@ -0,0 +1 @@
The path operator can be used to get the traversal paths of matching nodes in an expression. The path is returned as an array, which if traversed in order will lead to the matching node.

View File

@@ -1 +0,0 @@
The tag operator can be used to get or set the tag of ndoes (e.g. `!!str`, `!!int`, `!!bool`).

View File

@@ -0,0 +1 @@
The tag operator can be used to get or set the tag of nodes (e.g. `!!str`, `!!int`, `!!bool`).

View File

@@ -1 +0,0 @@
This is the simples (and perhaps most used) operator, it is used to navigate deeply into yaml structurse.

View File

@@ -0,0 +1 @@
This is the simplest (and perhaps most used) operator, it is used to navigate deeply into yaml structurse.