Query Operators

noun

say it: “KWEER-ee OP-uh-ray-terz” /ˈkwɪri ˈɑpəreɪtərz/

Special $-prefixed words in a MongoDB filter, such as $gt and $in, that describe conditions instead of exact values.

What is Query Operators?

Query operators start with $ and express conditions: $gt, $lte, $in, $ne, $exists, $regex, $and, $or.

db.recipes.find({ minutes: { $lte: 30 }, tags: { $in: ['vegan', 'quick'] } })

In a sentence

  • “$in is one of the query operators: { tags: { $in: ["vegan", "quick"] } }.”
  • “Query operators such as $lte find every plant at $20 or less.”

Level: Apprentice · More MongoDB terms at this level

Updated