Section: Filter patterns

Match a list of values

javascript
javascript
db.orders.find({ status: { $in: ["paid", "shipped"] } })
Explanation

Useful for dashboard queries and status subsets.

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 Filter patterns
Comparison operators
Filter with range operators.
OpenIn sheetjavascriptsame section
Combine clauses with $or
Match one of several conditions.
OpenIn sheetjavascriptsame section
Check field existence
Find documents that have or do not have a field.
OpenIn sheetjavascriptsame section
Regex match
Search string values with a regular expression.
OpenIn sheetjavascriptsame section
Project selected fields
Return only specific fields from matches.
OpenIn sheetjavascript1 tag match
Sort newest first
Sort descending on a field.
OpenIn sheetjavascript1 tag match