y
y
yq
v4.x
Search
⌃
K
y
y
yq
v4.x
Search
⌃
K
yq
How It Works
Recipes
Upgrading from V3
Commands
Evaluate
Evaluate All
Shell Completion
Operators
Add
Alternative (Default value)
Anchor and Alias Operators
Array to Map
Assign (Update)
Boolean Operators
Collect into Array
Column
Comment Operators
Compare Operators
Contains
Create, Collect into Object
Date Time
Delete
Divide
Document Index
Encode / Decode
Entries
Env Variable Operators
Equals
Eval
File Operators
Filter Operator
Flatten
Group By
Has
Keys
Length
Line
Load
Map
Modulo
Multiply (Merge)
Parent
Path
Pick
Pipe
Recursive Descent (Glob)
Reduce
Reverse
Select
Shuffle
Slice Array
Sort
Sort Keys
Split into Documents
String Operators
Style
Subtract
Tag
Traverse (Read)
Union
Unique
Variable Operators
With
Usage
Output format
Working with CSV, TSV
Working with JSON
Working with Properties
Working with XML
Working with LUA
Working with TOML
Working with Shell Output
Front Matter
Split into multiple files
GitHub Action
Tips, Tricks, Troubleshooting
Github Page
Powered By
GitBook
Map
Maps values of an array. Use
map_values
to map values of an object.
Map array
Given a sample.yml file of:
-
1
-
2
-
3
then
yq
'map(. + 1)'
sample.yml
will output
-
2
-
3
-
4
Map object values
Given a sample.yml file of:
a
:
1
b
:
2
c
:
3
then
yq
'map_values(. + 1)'
sample.yml
will output
a
:
2
b
:
3
c
:
4
Previous
Load
Next
Modulo
Last modified
10mo ago