Add filter operation (#1588)

* add filter operation

* add tests

* add tests

* revert debug

* simplify filter

* fix tests

* remove logs
This commit is contained in:
Robert Brennan
2023-03-09 10:30:47 +11:00
committed by GitHub
parent d30941b575
commit 9539877ff6
5 changed files with 102 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
## Filter array
Given a sample.yml file of:
```yaml
- 1
- 2
- 3
```
then
```bash
yq 'filter(. < 3)' sample.yml
```
will output
```yaml
- 1
- 2
```