×

Special Offer! December Sale Offer at DumpsCity! Get 25% Off on All Certification Exam Questions. Use Code: XMASk24  

Free MongoDB C100DEV Exam Questions

Try our Free Demo Practice Tests for Comprehensive C100DEV Exam Preparation

  • MongoDB C100DEV Exam Questions
  • Provided By: MongoDB
  • Exam: MongoDB Certified Developer Associate
  • Certification: MongoDB Certified Developer Associate
  • Total Questions: 411
  • Updated On: Nov 26, 2024
  • Rated: 4.9 |
  • Online Users: 822
Page No. 1 of 83
Add To Cart
  • Question 1
    • 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
  • Question 2
    • We have a movies collection with the following document structure:
      {
          _id: ObjectId("573a1390f29313caabcd6223"),
          genres: [ 'Comedy', 'Drama', 'Family' ],
          title: 'The Poor Little Rich Girl',
          released: ISODate("1917-03-05T00:00:00.000Z"),
          year: 1917,
          imdb: { rating: 6.9, votes: 884, id: 8443 }
      }
      We need to use Aggregation Framework to fetch all movies from this collection where 'Drama' is not in genres list and the minimum 'imdb.votes' is at least 100. Additionally, in the projection stage, we want to leave only the following fields:
      -> title
      -> genres
      -> imdb.votes
      We also want to sort the result set by decreasing imdb votes and limit the number of documents retuned to 5.
      Example output:
      [
          {
              imdb: { votes: 1294646 },
              genres: [ 'Action', 'Mystery', 'Sci-Fi' ],
              title: 'Inception'
          },
          {
              imdb: { votes: 1109724 },
              genres: [ 'Adventure', 'Fantasy' ],
              title: 'The Lord of the Rings: The Fellowship of the Ring'
          },
          {
              imdb: { votes: 1081144 },
              genres: [ 'Adventure', 'Fantasy' ],
              title: 'The Lord of the Rings: The Return of the King'
          },
          {
              imdb: { votes: 1080566 },
              genres: [ 'Action', 'Sci-Fi' ],
              title: 'The Matrix'
          },
          {
              imdb: { votes: 1004805 },
              genres: [ 'Action', 'Thriller' ],
              title: 'The Dark Knight Rises'
          }
      ]
      Which pipeline should you use?

      Answer: B
  • Question 3
    • Consider the following documents in a MongoDB collection orders:
      {
         "_id": 1,
         "customer_id": 101,
         "item": "apple",
         "price": 0.5,
         "quantity": 100,
         "date": ISODate("2022-01-01T00:00:00Z")
      },
      {
         "_id": 2,
         "customer_id": 102,
         "item": "banana",
         "price": 0.25,
         "quantity": 50,
         "date": ISODate("2022-01-02T00:00:00Z")
      },
      {
         "_id": 3,
         "customer_id": 101,
         "item": "orange",
         "price": 0.75,
         "quantity": 75,
         "date": ISODate("2022-01-03T00:00:00Z")
      }
      What is the aggregation pipeline to group the documents by "customer_id" and calculate the sum of the "quantity" field for each group, sorted in descending order by the sum of the "quantity" field?

      Answer: D
  • Question 4
    • Which of the following queries can use an index on the title field? (select 2)


      Answer: A,B
  • Question 5
    • You have two collections in your MongoDB database: students and grades. The students collection contains the following document:
      {
          "_id": ObjectId("64d5b0e5c9d95a76ac3ebed2"),
          "student_id": 1,
          "name": "Alice"
      }
      The grades collection contains the following documents:
      {
          "_id": ObjectId("64d5b0e5c9d95a76ac3ebed3"),
          "student_id": 2,
          "course": "Math",
          "grade": "A"
      },
      {
          "_id": ObjectId("64d5b0e5c9d95a76ac3ebed4"),
          "student_id": 2,
          "course": "Science",
          "grade": "B"
      }
      You run the following aggregation query to retrieve students along with their grades:
      db.students.aggregate([
          {
              $lookup: {
                  from: "grades",
                  localField: "student_id",
                  foreignField: "student_id",
                  as: "grades_details"
              }
          }
      ])
      What will be the structure of the documents returned by this aggregation query for the student with student_id: 1?

      Answer: B
PAGE: 1 - 83
Add To Cart

© Copyrights Dumpscity 2024. All Rights Reserved

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