Pre-Winter Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > MongoDB > MongoDB Certified DBA Associate > C100DBA

C100DBA MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) Question and Answers

Question # 4

In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member replica set and we want to assure that the writes are committed to journal. What should be the value of j?

A.

7

B.

2

C.

1

D.

0

Full Access
Question # 5

What read preference should your application use if you want to read from the primary under normal circumstances but allow reads from secondaries when a primary is unavailable?

A.

secondaryPreferred

B.

Secondary

C.

nearest

D.

primary

E.

primaryPreferred

Full Access
Question # 6

A MongoDB collection named users contains sample documents with fields including name, age, address, description, city, and occupation.

The administrator uses the following query to perform a collection scan:

db.users.find({ city: " New York " , occupation: " Software Engineer " })

What compound index will improve the performance of the query the MOST?

A.

db.users.createIndex({ city: 1, name: 1 })

B.

db.users.createIndex({ city: 1, occupation: 1 })

C.

db.users.createIndex({ occupation: 1, name: 1 })

D.

db.users.createIndex({ occupation: 1, city: 1 })

Full Access
Question # 7

Consider the following posts document:

Which of the following queries will return the documents but with only the first two tags in the tags array?

A.

db.posts.find({author: " Tom " ».limit({tags:2})

B.

db.posts.find({author: " Tom " ».limit($slice:{tags:2 > )

C.

Both " db.posts.find({author: " Tom " },{tags:{$slice:2}}) " and " db.posts.find({author: " Tom " }).limit($slice: {tags:2}) " are valid. $slice works both with projection and limit.

D.

db.posts.find({author: " Tom " > ,{tags:{$slice:2»)

Full Access
Question # 8

Which TWO commands can be used to check for all active operations on the current node?

A.

db.currentOp({ op : " command " })

B.

db.adminCommand({ " all " : currentOp})

C.

db.currentOp(true)

D.

db.adminCommand({ currentOp : true })

E.

db.currentOp({ " all " : true })

Full Access
Question # 9

Below is a sample document in a given collection test.

{ a : 5, b : 3, c: 2, d : 1 >

Given a compound index { a: 1, b:l, c:l, d:l}, Which of the below query will not use in-memory sorting? Select

all valid.

A.

db.test.find( { a: 5, b: 3 } ).sort( { c: 1, d : 1 } )

B.

db.test.find( { a: 5, b: 3 } ).sort( { a: 1} )

C.

db.test.find( { a: 5, b: 3 } ).sort( { a: 1, b: 1, c: 1 > )

D.

db.test.find( { a: 5, b: 3 } ).sort( {c: 1 } )

Full Access
Question # 10

In a sharded cluster, from which node does one stop the balancer process before initiating backup?

A.

Any node

B.

replicaset primary node

C.

config server node

D.

mongos node

Full Access
Question # 11

What is the first task that a secondary would perform on being prompted by another secondary for an election?

A.

Start the election process for primary

B.

Vote for the first secondary so that it would become the next primary

C.

Vote for itself and then call for election

D.

Connect to primary to confirm its availability

Full Access
Question # 12

Which are the ONLY ways to project portions of an array?

A.

$slice

B.

$

C.

All of the above

D.

$ elemMatch

Full Access
Question # 13

A MongoDB administrator is managing a database for a hospital system.

The patients collection contains:

- Carlos Martinez, diagnosis Hypertension, room 203

- Maria Lopez, diagnosis Hypertension, room 207

- Juan Perez, diagnosis Arrhythmia, room 207

The administrator runs:

db.patients.updateMany(

{ diagnosis: " Hypertension " },

{ $set: { room: 207 } }

)

What output should the administrator expect?

A.

acknowledged: true, matchedCount: 1, modifiedCount: 1

B.

acknowledged: true, matchedCount: 3, modifiedCount: 1

C.

acknowledged: true, matchedCount: 1, modifiedCount: 2

D.

acknowledged: true, matchedCount: 2, modifiedCount: 1

Full Access
Question # 14

Which command is used to determine storage capacity of specific database?

A.

mongotop

B.

dbstats

C.

mongostat

D.

constats

Full Access
Question # 15

What operation updates the value of the unitsInStock field to 25 for a document with a " laptop " product, and inserts a new document if it does not exist?

A.

db.inventory.updateOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: true })

B.

db.inventory.insertOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: true })

C.

db.inventory.insertOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: True })

D.

db.inventory.updateOne({ product: " laptop " }, { $set: { unitsInStock: 25 } }, { upsert: True })

Full Access
Question # 16

Which of the following statements are true about the $match pipeline operator? Check all that apply.

A.

You should use it early as possible in the pipeline

B.

It can be used as many time as needed.

C.

It has a sintax similar to findQ commands.

Full Access
Question # 17

Which of the following about Capped Collections is correct?

A.

Fixed Size

B.

Only " Fixed Size " and " High-throughput operations that insert and retrieve documents based on insertion order "

C.

High-throughput operations that insert and retrieve documents based on insertion order

D.

If the allocated space for a capped collection exceeds, it stops inserting new documents

Full Access
Question # 18

What does the following query do when performed on the posts collection? db.posts.update({_id:l},{Title:This is post with ID 1 " })

A.

Syntax error

B.

Replaces the complete document with _id as 1 with the document specified in second parameter

C.

Updates the Title of the post

D.

Updating a document is possible only with $set

Full Access
Question # 19

Which operations add new documents to a collection?

A.

Create

B.

update

C.

insert

D.

delete

Full Access
Question # 20

A MongoDB database administrator needs to improve the performance of the following query:

db.employees.find(

{},

{ name: 1, department: 0, salary: 1 }

).sort({ department: 1, salary: -1 });

What index should the administrator use to achieve this goal?

A.

db.employees.createIndex({ department: 1, salary: 1, name: 1 });

B.

db.employees.createIndex({ department: 1, salary: -1 });

C.

db.employees.createIndex({ salary: 1, name: 1, department: 0 });

D.

db.employees.createIndex({ name: 1, department: 1, salary: -1 });

Full Access
Question # 21

What is one purpose of a hidden index?

A.

To remove it from $indexStats aggregation stage.

B.

To reduce the cost of a collection scan.

C.

To test the impact of deleting the index without actually deleting it.

D.

To hide associated documents in the collection.

Full Access
Question # 22

Which of the following does MongoDB use to provide High Scalability?

A.

Replication

B.

Write Concern

C.

Indexing

D.

Sharding

Full Access
Question # 23

Which of the following does MongoDB use to provide High Availability and fault tolerance?

A.

Sharding

B.

Indexing

C.

Replication

D.

Write Concern

Full Access
Question # 24

You have the following index on the toys collection:

{

" manufacturer " : 1,

" name " : 1,

" date " : -1

}

Which of the following is able to use the index for the query? Check all that apply.

A.

db.toys.find( { name : " Big Rig Truck " , date : " 2013-02-01 " , manufacturer : " Tanko "

B.

db.toys.find( { manufacturer : " Matteo " , name : " Barbara " , date : " 2014-07-02 " } )

C.

db.toys.find( { date : " 2015-03-01 " , manufacturer : " Loggo " , name : " Brick Set " } )

Full Access
Question # 25

The difference between $push and $addToSet is:

A.

$addToSet needs the fields to be already present while $push will work even if the field is not present

B.

$addToSet adds the item to the field only if it does not exist already; while $push pushes the item to the field irrespective of whether it was present or not

C.

$addToSet adds the item to the field only if the new item is of the same datatype

D.

There is no major difference between them. $addToSet is a deprecated version of $push.

Full Access
Question # 26

Which TWO methods should an administrator use to create a backup of a MongoDB replica set?

A.

Utilize the mongoexport utility to create a backup.

B.

Utilize the mongofiles utility to create a backup.

C.

Utilize Filesystem Snapshots to create a backup.

D.

Utilize the bsondump utility to create a backup.

E.

Utilize the mongodump utility to create a backup.

Full Access
Question # 27

We can insert multiple documents in bulk using which of the following operations:

A.

initializeUnorderedBulk

B.

initializeUnorderedBulkOp

C.

initializeBulk

D.

initializeBulkOp

Full Access
Question # 28

Which command can be used to rebuild the indexes on a collection in MongoDB?

A.

db.collection.createlndex({relndex:l})

B.

db.collection.reIndex({author:l})

C.

db.collection.relndexQ

D.

db.collection.createIndex({author:l}).reIndex()

Full Access
Question # 29

A database administrator notices that operations on the qa database are not completing, and have been in progress for longer than expected.

What command can the administrator run to see information on in-progress operations on the qa database?

A.

db.listOps.ns(/^qa\./)

B.

db.listOps(/^qa\./)

C.

db.currentOp({ " ns " : /^qa\./})

D.

db.currentOp.ns(/^qa\./)

Full Access
Question # 30

Consider an inventory collection that contains these documents:

{ " _id " : 1, " product " : " x-small box " , " colors " : [ " brown " , " black " , " white " ], " qty " : 50 }

{ " _id " : 2, " product " : " small box " , " colors " : [ " brown " , " white " ], " qty " : 60 }

{ " _id " : 3, " product " : " medium box " , " colors " : [ " black " , " grey " , " white " ], " qty " : 45 }

{ " _id " : 4, " product " : " large box " , " colors " : [ " grey " ], " qty " : 50 }

{ " _id " : 5, " product " : " x-large box " , " colors " : [ " grey " , " white " ], " qty " : 10 }

What result set does the following query return?

db.inventory.find({

$or: [

{ " product " : " x-small box " },

{

$and: [

{ " qty " : { $ne: 50 } },

{ " colors " : { $nin: [ " brown " ] } }

]

}

]

})

A.

Documents _id:3 and _id:5.

B.

Documents _id:1 and _id:3.

C.

Documents _id:1, _id:2, _id:3, and _id:5.

D.

Documents _id:1, _id:3, and _id:5.

Full Access
Question # 31

Which of the following commands will return all the posts with number of likes greater than 100 and less than 200, both inclusive?

A.

db.posts.find({ likes : { $gte : 100 , $lte : 200 } } );

B.

db.posts.find({ likes : { $gt : 100 , $lte : 200 } } );

C.

db.posts.find({ likes : { $gte : 100, $lt : 200 } } );

D.

db.posts.find({ likes : { $gt : 100, $lt : 200 > > );

Full Access
Question # 32

Which is the default mode in which the explain() command runs?

A.

allPlansExecution

B.

customExecutionStats

C.

queryPlanner

D.

executionStats

Full Access
Question # 33

Consider the following example document:

{

" _id " : Objectld( " 5360c0a0a655a60674680bbe " ),

" user "

" login " : " irOn "

" description " : " Made of steel "

" date " : ISODate( " 2014-04-30T09:16:45.836Z " ),

}

>

and index creation command:

db.users.createlndex( { " user.login " : 1, " user.date " : -1 }, " mylndex " )

When performing the following query:

db.users.find( { " user.login " : /Air.*/ },

{ " user " :1, " _id " :0 > ).sort( { " user.date " :1 > )

which of the following statements correctly describe how MongoDB will handle the query? Check all that apply.

A.

As an optimized sort query (scanAndOrder = false) using " mylndex " because we are sorting on an indexed field

B.

As an indexed query using " mylndex " because field " user.login " is indexed

C.

MongoDB will need to do a table/collection scan to find matching documents

D.

None of the above

E.

As a covered query using " mylndex " because we are filtering out " _id " and only returning " user.login "

Full Access
Question # 34

What is the correct read preference option to direct all read operations to the secondary?

A.

secondaryPreferred

B.

secondariesPreferred

C.

secondaries

D.

secondary

Full Access
Question # 35

A MongoDB administrator is currently managing a single node MongoDB Enterprise deployment. The administrator is considering setting up replication with a secondary node and a delayed member.

Which TWO reasons align to the objectives of the administrator?

A.

Minimizing data loss when there are human errors.

B.

Allowing longer term data retention.

C.

Distributing data.

D.

Providing higher availability.

E.

Enabling encryption at rest.

Full Access
Question # 36

Which features of relational database management systems were deliberately omitted in MongoDB and help us to obtain horizontal scalability? Check all that apply.

A.

Multi-statement transactions

B.

Joins

C.

Authentication

Full Access
Question # 37

If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which of the following option is correct?

A.

None of the above

B.

The query used an index to fetch the results

C.

The query returned 0 documents

D.

The query returned 30000 documents after scanning the documents

Full Access
Question # 38

Dada una coleccion, cuales devuelve con la siguiente query db.coleccion.find({nombre: " ruben " ,apellido: " gomez " },{nombre:l,apellido:l,aficion:l});

A.

{ " -id " : Objectld( " 580a42b5dfblb5al7427d302 " ), " nombre " : " ruben " , " apellido " : " gomez " , " aficion " : v u " flipar " }

B.

{ " _id " : Objectld( " 580a42acdfblb5al7427d301 " ), " nombre " : " Luis " , " apellido " : " gomez " , " aficion " : u " flipar " }

C.

{ " _id " : Objectld( " 580a42acdfblb5al7427d301 " ), " nombre " : " ruben " , " apellido " : " Pablo " , " aficion " : u " flipar " }

D.

{ " _id " : Objectld( " 580a42acdfblb5al7427d301 " ), " nombre " : " ruben " , " apellido " : " gomez " >

Full Access
Question # 39

Which of the following are common uses of the mongo shell? Check all that apply

A.

Perform queries against MongoDB collections

B.

Perform administrative tasks

C.

Use as a JavaScript framework for your production system

Full Access
Question # 40

You have designed a web application with mongoDB. You have configured replication. The replica set is in place and function properly. What happens in case of failure?

A.

Switchover needs to be done manually

B.

Failover happens automatically

C.

Switchover happens automatically

D.

Failover needs to be done manually

Full Access
Question # 41

MongoDB is a schema-less design.

A.

False

B.

True

Full Access
Question # 42

In a replica set, which member is responsible for maintaining copies of the primary ' s data?

A.

Secondary

B.

Mongos

C.

Arbiter

D.

Shard

Full Access
Question # 43

Consider the following documents:

You perform the following query;

How many documents will be updated by the query?

A.

0

B.

1

C.

2

D.

3

E.

5

Full Access
Question # 44

What mongosh command connects to node-1.cluster1.mycompany.local on port 27017?

A.

mongosh --hostname " node-1.cluster1.mycompany.local:27017 "

B.

mongosh --connect " node-1.cluster1.mycompany.local:27017 "

C.

mongosh " node-1.cluster1.mycompany.local & port=27017 "

D.

mongosh " node-1.cluster1.mycompany.local:27017 "

Full Access
Question # 45

What is the maximum size of Index Key Limit and Number of Indexes per collection?

A.

1024 bytes and 64 indexes

B.

12 mega bytes and 64 indexes

C.

64 bytes and 1024 indexes

D.

1024 bytes and unlimited indexes

Full Access
Question # 46

Which of the tags in a replica set configuration specify the operations to be read from the node with the least network latency?

A.

netLatency

B.

secondaryPreferred

C.

nearest

D.

primaryPreferred

Full Access
Question # 47

Which type of indexes does MongoDB support?

A.

All of the above

B.

Compound Indexes

C.

Multikey Indexes

D.

Geospatial Indexes

Full Access
Question # 48

What does the following $slice query return using the following command? db.posts.find( {}, { comments: { $slice: [ -10, 5 ] } } )

A.

Returns 5 comments, beginning with the last 10 items

B.

Returns 10 comments, beginning with the last

C.

Returns 10 comments, beginning with the first

D.

Returns 5 comments, beginning with the first 10 items

Full Access
Question # 49

What feature is one of the differences between using MongoDB and a relational database management system (RDBMS) database?

A.

Sharding

B.

Replication

C.

Authentication

D.

Flexible Schema

Full Access
Question # 50

Which of the following is supported by MongoDB?

A.

Transaction Management

B.

ACID Transactions

C.

Journaling

D.

Relationships between Collections (Primary Key Foreign Key)

Full Access
Question # 51

Which of the following is true of the mechanics of replication in MongoDB? Check all that apply.

A.

Members of a replica set may replicate data from any other data-bearing member of the set by default

B.

Clients read from the nearest member of a replica ser by default

C.

Operations on the primary are recorded in a capped collection called the oplog

Full Access