Increase your chances of passing the MongoDB C100DEV exam questions on your first try. Practice with our free online C100DEV exam mock test designed to help you prepare effectively and confidently.
Consider a MongoDB database managing e-commerce product data. The database has a collection named products with documents containing the fields product_id, category, price, and reviews. Each reviews field is an array of subdocuments with fields user_id, rating, and comment. You are tasked with optimizing a query that retrieves all products within a specific category that have an average rating higher than 4. The query is frequently used, and performance is critical. Which indexing strategy would best optimize this query?
Which of the following stages do you need to use to randomly select 10 documents from a specific collection?
Given a movies collection where each document has the following structure:{ _id: ObjectId('573a1390f29313caabcd60e4'), genres: [ 'Short', 'Comedy', 'Drama' ], title: 'The Immigrant', year: 1917, imdb: { rating: 7.8, votes: 4680, id: 8133 }, countries: [ 'USA' ]}Which of the following queries will find all the movies that have more votes than the year in which they were released?
Consider a MongoDB database containing a collection of documents representing online orders for an e-commerce website. The documents have the following structure:{ "_id": ObjectId("5f95a1d11a12b400001b75c0"), "order_number": "ORD-001", "order_date": ISODate("2022-01-01T00:00:00.000Z"), "customer": { "name": "John Doe", "email": "[email protected]" }, "items": [ { "product_name": "Smartphone", "quantity": 2, "price": 800 }, { "product_name": "Laptop", "quantity": 1, "price": 1500 } ], "shipping_address": { "street": "123 Main St", "city": "New York", "state": "NY", "zipcode": "10001" }, "total_amount": 3000}Select an aggregation pipeline that returns the total sales amount by state and month, for orders placed in the year 2022. The result should have the following format:
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 }},{ _id: ObjectId("573a13e3f29313caabdc08a4"), genres: [ 'Horror', 'Thriller' ], title: 'Mary Loss of Soul', year: 2014, imdb: { rating: '', votes: '', id: 2904798 }}We need to use Aggregation Framework to calculate the following aggregates:average imdb ratingminimum imdb ratingmaximum imdb ratingExpected output:[ { _id: null, avg_rating: 6.6934040649367255, min_rating: 1.6, max_rating: 9.6 }]Please note that some documents have "" (empty string) for the field "imdb.rating". Exclude these documents before aggregation.Which pipeline should you use?
© Copyrights FreeMockExams 2026. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (FreeMockExams). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreeMockExams.