yq/pkg/yqlib/doc/operators/max.md
Mike Farah fe84f62288 Docs
2024-03-30 14:01:42 +11:00

485 B

Max

Computes the maximum among an incoming sequence of scalar values.

Maximum int

Given a sample.yml file of:

- 99
- 16
- 12
- 6
- 66

then

yq 'max' sample.yml

will output

99

Maximum string

Given a sample.yml file of:

- foo
- bar
- baz

then

yq 'max' sample.yml

will output

foo

Maximum of empty

Given a sample.yml file of:

[]

then

yq 'max' sample.yml

will output