🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to MongoDB Notes
Topic #17

$match


Aggregation $match

This aggregation stage behaves like a find. It will filter documents that match the query provided.

Note: Using $match early in the pipeline can improve performance since it limits the number of documents the next stages must process.

Example

db.listingsAndReviews.aggregate([
  { $match : { property_type : "House" } },
  { $limit: 2 },
  { $project: {
    "name": 1,
    "bedrooms": 1,
    "price": 1
  }}
])

This will only return documents that have the property_type of "House".

Want to go beyond the notes?

Join CodingNow 2.0's MongoDB course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

$match – FAQs

Quick answers about learning $match in MongoDB.

This free note from CodingNow 2.0 explains $match in MongoDB — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every MongoDB topic on CodingNow 2.0, including $match, is 100% free with no signup required.
With focused practice, most students grasp $match in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now