# Logical Operators

*noun*

say it: **“LOJ-ih-kul OP-uh-ray-terz”** **/ˈlɑdʒɪkəl ˈɑpəreɪtərz/**

Words that join or flip true-or-false conditions, such as and, or and not; in a MongoDB filter they start with a dollar sign, such as $or.

## What are **logical operators** in a MongoDB filter?

**Logical operators** combine conditions in a filter: `$or` matches when any condition is true, `$and` when all are, `$nor` when none is, and `$not` flips one condition. `$or`, `$and` and `$nor` take a list of conditions.

```javascript
db.recipes.find({ $or: [{ cuisine: "Thai" }, { minutes: { $lt: 15 } }] });
// every Thai recipe, plus any recipe under 15 minutes
```

## In a sentence

- “A filter with two fields is already an and, so the **logical operators** matter most for or.”
- “**Logical operators** let the filter ask for recipes that are vegetarian or quick, not only both.”

Level: Apprentice · [More MongoDB terms at this level](https://www.ask-codey.com/glossary?category=mongodb&level=2)

Updated: November 19, 2026

## In other subjects

- [Logical Operators in C#](https://www.ask-codey.com/glossary/logical-operators-c-sharp)
- [Logical Operators in Java](https://www.ask-codey.com/glossary/logical-operators-java)
- [Logical Operators in JavaScript](https://www.ask-codey.com/glossary/logical-operators-javascript)
- [Logical Operators in PowerShell](https://www.ask-codey.com/glossary/logical-operators-powershell)
- [Logical Operators in Python](https://www.ask-codey.com/glossary/logical-operators)

Source: https://www.ask-codey.com/glossary/logical-operators-mongodb
