Free MongoDB C100DEV Exam Questions

Become MongoDB Certified with updated C100DEV exam questions and correct answers

Page:    1 / 83      
Total 411 Questions | Updated On: Jun 15, 2022
Add To Cart
Question 1

As a MongoDB Developer, you are tasked with optimizing a MongoDB database. Your collection has documents with the following structure:
{
  "_id": ObjectId(),
  "user_id": Number,
  "user_data": {
    "name": String,
    "email": String,
    "phone": String,
    "address": {
      "city": String,
      "state": String,
      "country": String
    }
  },
  "transactions": [
    {
      "transaction_id": Number,
      "amount": Number,
      "date": Date
    }
  ]
}
The application frequently queries for the total transaction amount for users based on the city. Which index should you create to optimize the performance of these queries?


Answer: B
Question 2

Suppose you have a reviews collection with the following index:
{ stars: 1, votes: 1 }
Which of the following queries would be a covered query?


Answer: D
Question 3

Consider a collection named orders with the following documents:
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e1"),
   "order_number" : 1001,
   "customer_id" : "CUST-001",
   "order_date" : ISODate("2022-01-01T00:00:00Z"),
   "total_amount" : 199.99
},
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e2"),
   "order_number" : 1002,
   "customer_id" : "CUST-002",
   "order_date" : ISODate("2022-02-01T00:00:00Z"),
   "total_amount" : 299.99
},
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e3"),
   "order_number" : 1003,
   "customer_id" : "CUST-003",
   "order_date" : ISODate("2022-03-01T00:00:00Z"),
   "total_amount" : 399.99
}
What is the query to create a compound index on the "customer_id" (ascending) and "order_date" (descending) fields in the orders collection?


Answer: C
Question 4

Consider a collection named orders with the following documents:
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e1"),
   "order_id" : 101,
   "customer_name" : "John Doe",
   "order_date" : ISODate("2022-01-01T00:00:00.000Z"),
   "items" : [
      {
         "product_name" : "Apple",
         "quantity" : 2,
         "price" : 0.99
      },
      {
         "product_name" : "Banana",
         "quantity" : 5,
         "price" : 0.5
      }
   ]
}
 
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e2"),
   "order_id" : 102,
   "customer_name" : "Jane Doe",
   "order_date" : ISODate("2022-01-02T00:00:00.000Z"),
   "items" : [
      {
         "product_name" : "Orange",
         "quantity" : 3,
         "price" : 0.79
      },
      {
         "product_name" : "Mango",
         "quantity" : 2,
         "price" : 1.99
      }
   ]
}
 
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e3"),
   "order_id" : 103,
   "customer_name" : "Bob Smith",
   "order_date" : ISODate("2022-01-03T00:00:00.000Z"),
   "items" : [
      {
         "product_name" : "Peach",
         "quantity" : 4,
         "price" : 1.49
      },
      {
         "product_name" : "Pear",
         "quantity" : 1,
         "price" : 2.99
      }
   ]
}
What is the query to retrieve the total sales for each customer in the orders collection?


Answer: B
Question 5

Consider a collection named students with the following document:
{
   "_id" : ObjectId("5f0a7e80d8c9c7b5a48c49e1"),
   "name" : "Alice",
   "age" : 21,
   "courses" : [
      {
         "name" : "Math",
         "grade" : 89
      },
      {
         "name" : "Science",
         "grade" : 92
      }
   ]
}
What is the query to update the grade of the "Math" course for the student with "_id" equal to ObjectId("5f0a7e80d8c9c7b5a48c49e1") to 95?


Answer: C
Page:    1 / 83      
Total 411 Questions | Updated On: Jun 15, 2022
Add To Cart

© Copyrights DumpsCertify 2026. All Rights Reserved

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