Test whether an object includes certain key-value pairs.
Section: Object Basics
Check object contains subset
bash
bash
echo '{"role":"admin","active":true}' | jq 'contains({role: "admin"})'Explanation
Very useful for policy and config checks.
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 Object Basics