Filter items that satisfy two conditions.

Section: Boolean Logic

Logical AND

bash
bash
echo '[{"env":"prod","healthy":true},{"env":"dev","healthy":true}]' | jq '.[] | select(.env == "prod" and .healthy)'
Explanation

Combine predicates with `and` and `or`.

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 Boolean Logic
Logical OR
Match either of two conditions.
OpenIn sheetbashsame section
Logical NOT
Invert a predicate.
OpenIn sheetbashsame section
Test membership with IN
Check whether a value appears in a stream.
OpenIn sheetbashsame section
Test regex match
Return true if a string matches a pattern.
OpenIn sheetbash1 tag match
Floor number
Round down to nearest integer.
OpenIn sheetbash1 tag match
Current Unix time
Get the current time as Unix epoch seconds.
OpenIn sheetbash1 tag match