Free MongoDB C100DEV Exam Questions

Become MongoDB Certified with updated C100DEV exam questions and correct answers

Page:    1 / 83      
Total 411 Questions | Updated On: Jan 09, 2025
Add To Cart
Question 1

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 2

Consider a MongoDB database containing a collection of documents representing product information for an e-commerce website. The documents have the following structure:
{
   "_id": ObjectId("5f95a1d11a12b400001b75c0"),
   "product_name": "Smartphone",
   "brand": "Apple",
   "price": 800,
   "categories": [ "Electronics", "Smartphones" ],
   "reviews": [
      { "username": "user1", "rating": 4, "comment": "Great product!" },
      { "username": "user2", "rating": 5, "comment": "Excellent!" },
      { "username": "user3", "rating": 3, "comment": "Good but overpriced." }
   ]
}
Select the MongoDB aggregation pipeline that returns the average rating of all products grouped by brand. The result should include only brands with an average rating greater than or equal to 4. The output should have the following format:


Answer: D
Question 3

Suppose you have a restaurants collection with the following document structure:

{

  _id: ObjectId("5eb3d668b31de5d588f42931"),

  address: {

    building: '6409',

    coord: [ -74.00528899999999, 40.628886 ],

    street: '11 Avenue',

    zipcode: '11219'

  },

  borough: 'Brooklyn',

  cuisine: 'American',

  grades: [

    {

      date: ISODate("2014-07-18T00:00:00.000Z"),

      grade: 'A',

      score: 12

    },

    {

      date: ISODate("2013-07-30T00:00:00.000Z"),

      grade: 'A',

      score: 12

    },

    {

      date: ISODate("2013-02-13T00:00:00.000Z"),

      grade: 'A',

      score: 11

    },

    { date: ISODate("2012-08-16T00:00:00.000Z"), 

      grade: 'A', 

      score: 2 },

    {

      date: ISODate("2011-08-17T00:00:00.000Z"),

      grade: 'A',

      score: 11

    }

  ],

  name: 'Regina Caterers',

  restaurant_id: '40356649'

}

You don't have any indexes so far. What will the query plan look like for the following query?

db.restaurants.find( { "cuisine": "American" } )


Answer: D
Question 4

What is the difference between a sparse index and a non-sparse index in MongoDB?


Answer: A
Question 5

We have an accounts collection with the following document structure:
{
  _id: ObjectId("5ca4bbc7a2dd94ee5816239d"),
  account_id: 864905,
  limit: 10000,
  products: [ 'Commodity', 'InvestmentStock' ]
},
{
  _id: ObjectId("5ca4bbc7a2dd94ee5816239e"),
  account_id: 299072,
  limit: 10000,
  products: [ 'InvestmentFund', 'InvestmentStock' ]
},
{
  _id: ObjectId("5ca4bbc7a2dd94ee5816239f"),
  account_id: 137994,
  limit: 10000,
  products: [ 'CurrencyService', 'InvestmentStock' ]
}
We need to use Aggregation Framework to find the distribution of products field. Sort the result set by decreasing total number of products.
Expected output:
[
    { _id: 'InvestmentStock', total: 1746 },
    { _id: 'CurrencyService', total: 742 },
    { _id: 'Brokerage', total: 741 },
    { _id: 'InvestmentFund', total: 728 },
    { _id: 'Commodity', total: 720 },
    { _id: 'Derivatives', total: 706 }
]
Which pipeline should you use?


Answer: B
Page:    1 / 83      
Total 411 Questions | Updated On: Jan 09, 2025
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

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