MongoDB Query Language and Operators Flashcards
7 cards from real MongoDB practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 MongoDB Query Language and Operators flashcards as text
Which MongoDB query operator matches documents where a field value is greater than a specified value?
Answer: $gt
$gt (greater than) selects documents where the field value is strictly greater than the specified value.
Which operator selects documents where a field value matches any value in a specified array?
Answer: $in
$in matches documents where the field value is equal to any value in the specified array.
What does the $and operator do in a MongoDB query?
Answer: Returns documents where all conditions are true
$and performs a logical AND, returning only documents where all specified conditions are true.
How do you apply a projection in a MongoDB find() query to return only specific fields?
Answer: db.col.find({filter}, {field: 1})
Projections are passed as the second argument to find(), with fields set to 1 to include them.
What does the $ne operator match in a MongoDB query?
Answer: Documents where the field value is not equal to the specified value
$ne (not equal) matches all documents where the field value does not equal the specified value.
Which operator is used to match documents where an array field contains all of the specified elements?
Answer: $all
$all matches arrays that contain every element in the specified list, regardless of order.
What is the correct MongoDB syntax to sort query results in descending order by a field named 'score'?
Answer: .sort({score: -1})
In MongoDB, -1 specifies descending sort order and 1 specifies ascending sort order.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- 10geneducation.zendesk.com — Test dates, score release, passing score, test delivery, retake policy · verified Oct 2026
- learn.mongodb.com — Eligibility, fees, exam format, time limit · verified Oct 2026