Select matching records from a YAML array.
Section: Read and query YAML with yq
Filter objects in a sequence
bash
bash
yq '.users[] | select(.role == "admin")' users.yamlExplanation
A practical pattern when using YAML as config or fixture data.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Read and query YAML with yq