Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 2 MCQs MongoDB Basics and CRUD Operations

CSE494 — Intelligent Nosql Databases 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Databases Easy

    What does a MongoDB database primarily contain?

  2. Question 2 of 60 Databases Easy

    Which MongoDB shell command displays the name of the currently selected database?

  3. Question 3 of 60 Collections Easy

    What is a collection in MongoDB?

  4. Question 4 of 60 Collections Easy

    A MongoDB collection is most similar to which concept in a relational database?

  5. Question 5 of 60 Documents Easy

    How is data organized inside a MongoDB document?

  6. Question 6 of 60 Documents Easy

    Which field is automatically used as the unique identifier of a MongoDB document?

  7. Question 7 of 60 Documents Easy

    Which operation adds a single document to a MongoDB collection?

  8. Question 8 of 60 Documents Easy

    Which method is commonly used to retrieve documents from a MongoDB collection?

  9. Question 9 of 60 BSON Data Types Easy

    What does BSON stand for?

  10. Question 10 of 60 BSON Data Types Easy

    Which BSON data type stores a true or false value?

  11. Question 11 of 60 BSON Data Types Easy

    Which BSON data type is commonly generated for the _id field by MongoDB?

  12. Question 12 of 60 BSON Data Types Easy

    Which BSON data type should be used to store a list of values in one field?

  13. Question 13 of 60 Creating and Dropping Databases and Collections Easy

    Which MongoDB shell command selects a database named school?

  14. Question 14 of 60 Creating and Dropping Databases and Collections Easy

    When is a newly selected MongoDB database normally created permanently?

  15. Question 15 of 60 Creating and Dropping Databases and Collections Easy

    Which command creates a collection named students explicitly?

  16. Question 16 of 60 Creating and Dropping Databases and Collections Easy

    Which command removes the currently selected MongoDB database?

  17. Question 17 of 60 Creating and Dropping Databases and Collections Easy

    Which command removes a collection named students?

  18. Question 18 of 60 Data Modeling in MongoDB Easy

    What is embedding in MongoDB data modeling?

  19. Question 19 of 60 Data Modeling in MongoDB Easy

    What is a reference in MongoDB data modeling?

  20. Question 20 of 60 Indexes and Query Optimization Easy

    What is the main purpose of an index in MongoDB?

  21. Question 21 of 60 Databases Medium

    A developer runs use inventory in mongosh, but inventory does not appear in show dbs. What action will make the database appear?

  22. Question 22 of 60 Creating and Dropping Databases and Collections Medium

    Which command explicitly creates an orders collection with a JSON Schema validator?

  23. Question 23 of 60 Creating and Dropping Databases and Collections Medium

    An administrator has selected the test_archive database and wants to permanently remove that database. Which command should be executed?

  24. Question 24 of 60 Collections Medium

    A collection must reject documents whose quantity field is not an integer. Which MongoDB feature is most appropriate?

  25. Question 25 of 60 Documents Medium

    Given { customer: { address: { city: "Pune" } } }, which filter correctly finds documents where the nested city is Pune?

  26. Question 26 of 60 Documents Medium

    A document contains scores: [{ subject: "Math", mark: 72 }, { subject: "Science", mark: 91 }]. Which filter requires subject: "Math" and mark: { $gt: 80 } to match the same array element?

  27. Question 27 of 60 Documents Medium

    Which update increments an existing stock value by 5 without replacing the rest of the document?

  28. Question 28 of 60 BSON Data Types Medium

    A financial application must store 19.99 without typical binary floating-point rounding. Which BSON value is most appropriate?

  29. Question 29 of 60 BSON Data Types Medium

    A query must compare event times chronologically and use a date index efficiently. How should new event times normally be stored?

  30. Question 30 of 60 BSON Data Types Medium

    A collection uses MongoDB's default _id values. Which statement about an ObjectId is correct?

  31. Question 31 of 60 BSON Data Types Medium

    A field can contain either an integer or a numeric string. Which query selects only documents where rating is stored as a string?

  32. Question 32 of 60 Data Modeling in MongoDB Medium

    An order's line items are always displayed with the order, are limited in number, and should remain as they were when purchased. Which model is most suitable?

  33. Question 33 of 60 Data Modeling in MongoDB Medium

    Millions of comments belong to articles, and comments are frequently paginated and updated independently. Which modeling choice is most appropriate?

  34. Question 34 of 60 Data Modeling in MongoDB Medium

    A user's shipping address and profile settings must be updated atomically in a single operation. Which design best supports this requirement?

  35. Question 35 of 60 Indexes and Query Optimization Medium

    A frequent query is find({ status: "PAID" }).sort({ createdAt: -1 }). Which index best supports both filtering and sorting?

  36. Question 36 of 60 Indexes and Query Optimization Medium

    Given a compound index { category: 1, price: 1, rating: -1 }, which query uses the index's longest valid prefix?

  37. Question 37 of 60 Indexes and Query Optimization Medium

    An index { email: 1, name: 1 } exists. Which query can be covered by this index without fetching documents, assuming _id is not needed?

  38. Question 38 of 60 Indexes and Query Optimization Medium

    A query is unexpectedly slow. Which command provides actual execution statistics such as examined keys and examined documents?

  39. Question 39 of 60 Indexes and Query Optimization Medium

    A collection has an index on the array field tags. What type of index does MongoDB automatically create for that field?

  40. Question 40 of 60 Indexes and Query Optimization Medium

    Only active accounts are frequently queried by email, while inactive accounts should not consume index space. Which index is most appropriate?

  41. Question 41 of 60 Databases Hard

    An administrator runs use telemetry in mongosh, then immediately checks show dbs. The telemetry database is absent. Which explanation is correct?

  42. Question 42 of 60 Creating and Dropping Databases and Collections Hard

    A script connects with db currently set to staging and executes db.dropDatabase(). It then inserts into db.events without issuing another use command. What is the expected result?

  43. Question 43 of 60 Collections Hard

    A collection has a JSON Schema validator and two secondary indexes. It is dropped and then recreated by inserting its first document. Which state should be expected?

  44. Question 44 of 60 Documents Hard

    Given documents {_id: 1, x: null}, {_id: 2}, and {_id: 3, x: 0}, which query matches only the document where x explicitly has the BSON null value?

  45. Question 45 of 60 BSON Data Types Hard

    A financial application must store 0.1 and perform server-side arithmetic without binary floating-point approximation. Which BSON type is most appropriate?

  46. Question 46 of 60 BSON Data Types Hard

    Two clients insert the same instant using BSON Date values, one from UTC and one from a +05:30 local time converted correctly by its driver. How are these values stored?

  47. Question 47 of 60 BSON Data Types Hard

    Why is sorting by a default ObjectId _id only an approximation of sorting by exact creation time?

  48. Question 48 of 60 Documents Hard

    A document contains items: [{sku: "A", qty: 2}, {sku: "B", qty: 20}]. Which query requires sku: "A" and qty: {$gt: 10} to be satisfied by the same array element?

  49. Question 49 of 60 Documents Hard

    A collection contains {_id: 7, status: "open", total: 40}. What happens when replaceOne({_id: 7}, {_id: 8, status: "closed"}) attempts to replace it?

  50. Question 50 of 60 Data Modeling in MongoDB Hard

    An order must preserve the product name and unit price exactly as they were at purchase time, even after the product catalog changes. Which model best supports this requirement?

  51. Question 51 of 60 Data Modeling in MongoDB Hard

    A sensor document appends one reading every second to an embedded array and is retained indefinitely. Which redesign most directly addresses the principal scaling risk?

  52. Question 52 of 60 Data Modeling in MongoDB Hard

    Users can belong to millions of groups, and groups can contain millions of users. Memberships are frequently added and removed, and queries run in both directions. Which primary model is most robust?

  53. Question 53 of 60 Indexes and Query Optimization Hard

    A frequent query is find({tenantId: 42, createdAt: {$gte: start}}).sort({score: -1}). Which compound index most closely follows the equality-sort-range guideline?

  54. Question 54 of 60 Indexes and Query Optimization Hard

    For an index {a: 1, b: -1}, which sort can use the index order directly when there is no filter?

  55. Question 55 of 60 Indexes and Query Optimization Hard

    A document has both tags: ["red", "sale"] and ratings: [4, 5]. Why can creating the compound index {tags: 1, ratings: 1} fail?

  56. Question 56 of 60 Indexes and Query Optimization Hard

    With index {tenantId: 1, email: 1}, which query and projection can be covered by that index, assuming no relevant collation or multikey complication?

  57. Question 57 of 60 Indexes and Query Optimization Hard

    A partial index is created as {email: 1} with partialFilterExpression: {active: true}. Which query is eligible to use it without a hint?

  58. Question 58 of 60 Indexes and Query Optimization Hard

    An index on {name: 1} was created with a case-insensitive English collation. A query filters by name but specifies the default simple collation. What is the key optimization consequence?

  59. Question 59 of 60 Indexes and Query Optimization Hard

    Given a standard ascending index on {username: 1}, which predicate is most likely to produce a bounded index scan?

  60. Question 60 of 60 Indexes and Query Optimization Hard

    An explain("executionStats") result shows totalKeysExamined: 200000, totalDocsExamined: 12, and nReturned: 12. What is the strongest conclusion?

That's unit 2

Answer a few questions and your score shows up here.