Returns the lengths of the nodes. Length is defined according to the type of the node.
returns length of string
Given a sample.yml file of:
a: cat
then
yq eval '.a | length' sample.yml
will output
3
returns number of entries
Given a sample.yml file of:
a: catc: dog
then
yq eval 'length' sample.yml
will output
2
returns number of elements
Given a sample.yml file of:
- 2- 4- 6- 8
then
yq eval 'length' sample.yml
will output
4