You pass an array of documents to insertMany. By default, one document in the middle fails a unique index check. What happens?
db.users.insertMany([doc1, doc2_dup, doc3])Read the full question →Every question is hand-checked, every answer comes with an explanation, and your progress builds into a clear picture of where you stand.
Every MongoDB question shows its code before you answer, so you are reading real MongoDB, not a description of it.
Once you attempt a question you get the reasoning, not just a tick. That matters most on MongoDB, where embedding versus referencing, multikey and compound index behaviour, aggregation pipeline stages, read and write concern trade-offs, sharding keys, and replica-set elections.
Progress is tracked per topic across the 53 MongoDB topics, so revision points at the gaps instead of the whole list.
589 MongoDB questions right now: 99 easy, 246 medium and 244 hard. That number is read straight from the question table when this page is built, so it is never a rounded marketing figure.
No. Every MongoDB question, including its code snippet, its difficulty and its topic, is readable without signing in. You need a free account only to submit an answer, see which option is correct, and read the worked explanation. We keep it that way so the platform stays honest about what you actually got right.
Embedding versus referencing, multikey and compound index behaviour, aggregation pipeline stages, read and write concern trade-offs, sharding keys, and replica-set elections.
53 distinct topics are tagged on the MongoDB questions, including covered queries internals, WiredTiger storage engine, multikey array indexes, aggregation $match $group, read concern levels, text and $regex search. The topic labels come from the questions themselves, so the list matches what you will actually be asked.
Yes. Reading is free and unlimited. A free account unlocks answering, explanations and progress tracking. Pro (₹199 per month) adds AI explanations and AI-graded guesstimates on top; it is not needed to practise MongoDB MCQs.
Backend roles at document-store shops, analytics pipelines, and teams running Atlas in production.
These are 12 of the 589 MongoDB questions in the library, pulled live from the question table. The snippet, the difficulty and the topic are all here. The answer options and the explanation are not. Those need a free account.
Embedding versus referencing, multikey and compound index behaviour, aggregation pipeline stages, read and write concern trade-offs, sharding keys, and replica-set elections.
db.users.insertMany([doc1, doc2_dup, doc3])Read the full question →db.col.updateOne({ _id: 1 }, { $pull: { items: { k: 'a' } } })Read the full question →const result = db.users.find({ active: true });Read the full question →db.people.insertOne({ name: "Ann", age: 30 })
db.people.insertOne({ name: "Bob", city: "NYC", hobbies: ["chess"] })Read the full question →db.users.deleteOne({ email: "missing@example.com" })Read the full question →db.logs.deleteMany({})Read the full question →db.users.find({})Read the full question →db.orders.updateOne(
{ status: "pending" },
{ $set: { status: "shipped" } }
)Read the full question →db.products.find({ price: { $gt: 100 } })Read the full question →const ObjectId = require("mongodb").ObjectId;
const a = new ObjectId("507f1f77bcf86cd799439011");
const b = new ObjectId("507f1f77bcf86cd799439011");
console.log(a === b);
console.log(a.equals(b));Read the full question →db.players.find().sort({ score: -1 }).limit(1)Read the full question →db.users.find({}, { age: 0, city: 0 })Read the full question →We keep the correct answer, the explanation and the scoring behind sign-in so the platform stays honest, which is why the correct option and the worked explanation for every MongoDB question stay behind a free account. Signing in is free and takes a few seconds.
Backend roles at document-store shops, analytics pipelines, and teams running Atlas in production.