yq/pkg/yqlib/doc/operators/headers/equals.md

23 lines
633 B
Markdown
Raw Normal View History

2022-03-15 23:16:49 +00:00
# Equals / Not Equals
2021-11-03 04:00:58 +00:00
This is a boolean operator that will return `true` if the LHS is equal to the RHS and `false` otherwise.
2020-11-17 22:44:16 +00:00
```
.a == .b
```
It is most often used with the select operator to find particular nodes:
```
select(.a == .b)
```
2022-03-15 23:16:49 +00:00
The not equals `!=` operator returns `false` if the LHS is equal to the RHS.
2022-03-17 03:08:08 +00:00
## Related Operators
2022-03-29 00:08:50 +00:00
- comparison (`>=`, `<` etc) operators [here](https://mikefarah.gitbook.io/yq/operators/compare)
- boolean operators (`and`, `or`, `any` etc) [here](https://mikefarah.gitbook.io/yq/operators/boolean-operators)
- select operator [here](https://mikefarah.gitbook.io/yq/operators/select)
2022-03-17 03:08:08 +00:00