Database IntegrationLesson 64Free preview
MongoDB Query
This lesson is part of Node.js · All levels
Summary
This lesson deepens the ability to filter MongoDB data with query operators like $gt, $lt, $in, and $or. You're going to blend a few conditions into one filter for a precision query. These operators make MongoDB flexible even without the formal SQL language.
Key points
- The base filter {field: value} means the column is equal to the value.
- The comparison operator: $eq, $ne, $gt, $gte, $lt, $lte.
- $in and $nin select values from a particular list.
- $or, $and, $not combines some logical conditions.
- Queries are nested using dot notation, e.g. {'spec.weight': {$gt: 1}}.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.