Free Practice MongoDB C100DEV Exam Questions 2026

Stay ahead with 100% Free MongoDB Certified Developer Associate C100DEV Dumps Practice Questions

Page:    1 / 83      
Total 411 Questions | Updated On: May 23, 2026
Add To Cart
Question 1

You manage a MongoDB collection called inventory that stores documents for a store's inventory. Each document has the fields item, category, and quantity. You want to ensure that an item is always present in the collection, even if it needs to be inserted. Specifically, if the item "notebook" in the "Stationery" category does not exist, it should be inserted with a quantity of 50. If it does exist, its quantity should be updated to 50. You plan to use the following command:
db.inventory.updateOne(
  { "item": "notebook", "category": "Stationery" },
  { $set: { "quantity": 50 } },
  { upsert: true }
)
What will happen after executing this command if there is no "notebook" item in the "Stationery" category in the inventory collection?


Answer: D
Question 2

Given the following orders collection in MongoDB:
[
  {
    "_id": 1,
    "customer": "John",
    "orderDetails": [
      { "productId": "P1", "quantity": 2, "unitPrice": 50 },
      { "productId": "P2", "quantity": 1, "unitPrice": 30 }
    ]
  },
  {
    "_id": 2,
    "customer": "Sara",
    "orderDetails": [
      { "productId": "P1", "quantity": 3, "unitPrice": 50 },
      { "productId": "P3", "quantity": 2, "unitPrice": 20 }
    ]
  },
  {
    "_id": 3,
    "customer": "Peter",
    "orderDetails": [
      { "productId": "P2", "quantity": 2, "unitPrice": 30 },
      { "productId": "P4", "quantity": 1, "unitPrice": 100 }
    ]
  }
]
Which MongoDB query will find all orders that contain a product with the productId of "P1" and a quantity greater than 1?


Answer: A
Question 3

As a MongoDB Developer, you are tasked with the deletion of specific documents in a collection named users. The documents to be deleted are those that meet the following criteria: the age field is less than 18 and the status field is "inactive". After the deletion, you need to know the count of the deleted documents. Which of the following commands would correctly perform this operation?


Answer: A
Question 4

A collection called players contains the following documents:
[
  { _id: 1, user: 'Tom', scores: [ 23, 56, 3, 52, 62 ], bonus: 5 },
  { _id: 2, user: 'Jane', scores: [ 42, 50, 10 ], bonus: 3 }
]
You want to add additional fields to each document:
-> total_score (sum of the scores Array)
-> avg_score (average score in scores Array)
-> total_score_with_bonus (total_score + bonus)
Expected output:
[
  {
    _id: 1,
    user: 'Tom',
    scores: [ 23, 56, 3, 52, 62 ],
    bonus: 5,
    total_score: 196,
    avg_score: 39.2,
    total_score_with_bonus: 201
  },
  {
    _id: 2,
    user: 'Jane',
    scores: [ 42, 50, 10 ],
    bonus: 3,
    total_score: 102,
    avg_score: 34,
    total_score_with_bonus: 105
  }
]
Which query do you need to use?


Answer: A
Question 5

In your database there is a collection named sales with the following document structure:
{
  _id: ObjectId("5bd761dcae323e45a93ccfe8"),
  saleDate: ISODate("2015-03-23T21:06:49.506Z"),
  items: [
    {
      name: 'printer paper',
      tags: [ 'office', 'stationary' ],
      price: Decimal128("40.01"),
      quantity: 2
    },
    {
      name: 'notepad',
      tags: [ 'office', 'writing', 'school' ],
      price: Decimal128("35.29"),
      quantity: 2
    },
    {
      name: 'pens',
      tags: [ 'writing', 'school', 'stationary' ],
      price: Decimal128("56.12"),
      quantity: 5
    }
  ],
  storeLocation: 'Denver',
  customer: { gender: 'M', age: 42, email: '[email protected]', satisfaction: 4 },
  purchaseMethod: 'Online'
}
{
  _id: ObjectId("5bd761dcae323e45a93ccfe9"),
  saleDate: ISODate("2015-08-25T10:01:02.918Z"),
  items: [
    {
      name: 'binder',
      tags: [ 'school', 'general', 'organization' ],
      price: Decimal128("28.31"),
      quantity: 9
    },
    {
      name: 'backpack',
      tags: [ 'school', 'travel', 'kids' ],
      price: Decimal128("83.28"),
      quantity: 2
    }
  ],
  storeLocation: 'Seattle',
  customer: { gender: 'M', age: 50, email: '[email protected]', satisfaction: 5 },
  couponUsed: false,
  purchaseMethod: 'Phone'
}
How can you extract all documents from this collection where the first tag in the tags field (Array) is 'office' in at least one item?


Answer: B
Page:    1 / 83      
Total 411 Questions | Updated On: May 23, 2026
Add To Cart

© Copyrights TheExamsLab 2026. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLab.