Weekend Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: w75best

MongoDB C100DBA Dumps

Page: 1 / 17
Total 172 questions

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

Question 1

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

Options:

A.

secondaryPreferred

B.

secondariesPreferred

C.

secondaries

D.

secondary

Question 2

The difference between $push and $addToSet is:

Options:

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.

Question 3

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

Options:

A.

mongotop

B.

dbstats

C.

mongostat

D.

constats

Question 4

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?

Options:

A.

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

B.

db.listOps(/^qa\./)

C.

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

D.

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

Question 5

Which of the following is correct about MongoDB?

Options:

A.

MongoDB supports geospatial indexes

B.

MongoDB supports some of the SQL functions

C.

MongoDB uses JSON format to represent documents

D.

MongoDB supports collection joins

Question 6

What " stage " indicates that no indexes were available for a query pattern?

Options:

A.

FETCH

B.

IXSCAN

C.

COLLSCAN

D.

GROUP

Question 7

Which TWO mongosh commands can be used to shutdown the mongod daemon?

Options:

A.

db.adminCommand({ " shutdown " : 1 })

B.

use admindb.adminCommand({ " killOp " : 1, " op " : 27017 })

C.

use admindb.runCommand({ killAllSessions: [ { user: " * " , db: " * " } ] })

D.

use admindb.shutdownServer()

Question 8

JSON stands for

Options:

A.

JavaScript Object Notation

B.

JavaScript Object Naming

C.

JavaScript Object Notice

D.

None of the above

Question 9

MongoDB is

Options:

A.

None of the above

B.

Object-oriented DBMS

C.

Relational DBMS

D.

Document-oriented DBMS

Question 10

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

Options:

A.

$slice

B.

$

C.

All of the above

D.

$ elemMatch

Question 11

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

Options:

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

Question 12

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

Options:

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 " >

Question 13

What is the output of following two commands in MongoDB: db. posts. insert({n_id " :l}) db.posts.insert({ " _id " :l})

Options:

A.

Two documents will be inserted with _id as 1

B.

MongoDB will automatically increment the _id of the second document as 2

C.

This will throw a duplicate key error

D.

It will insert two documents and throw a warning to the user

Question 14

Consider the following posts document:

as

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

Options:

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»)

Question 15

What does the totalCreated field mean in the output of the db.serverStatus().connections command?

> db.serverStatus().connections

{

" current " : 4,

" available " : 51196,

" totalCreated " : 5,

" active " : 2,

" threaded " : 4,

" exhaustIsMaster " : 1,

" exhaustHello " : 0,

" awaitingTopologyChanges " : 1

}

Options:

A.

The number of closed connections in the server ' s history.

B.

The number of connections since the server was set up.

C.

The total number of database connections at the moment.

D.

The number of connections since the server was started.

Question 16

You have a replicated cluster with 1 primary, 3 secondary, 1 arbiter. One of the secondary is hidden. What is the replication factor of this replicated cluster?

Options:

A.

7

B.

03

C.

04

D.

06

Question 17

Which of the following node is used during election in a replication cluster?

Options:

A.

primary

B.

arbiter

C.

hidden

D.

secondary

Question 18

Given the following MongoDB documents in the cars collection:

{

" carid " : 1,

" make " : " Toyota " ,

" model " : " Celica " ,

" mileage " : 143121,

" color " : " Red " ,

" year " : 2003,

" features " : [ " Leather Interior " , " 2WD " , " CD Player " ]

},

{

" carid " : 2,

" make " : " Honda " ,

" model " : " Civic " ,

" mileage " : 12000,

" color " : " White " ,

" year " : 2020,

" features " : [ " Cloth Interior " , " Sun Roof " , " XM Radio " ]

},

{

" carid " : 3,

" make " : " Tesla " ,

" model " : " Model S " ,

" mileage " : 5,

" color " : " Silver " ,

" year " : 2022,

" features " : [ " Leather Interior " , " Sun Roof " , " Auto Pilot " ]

}

What documents are returned from running the following $in query?

db.cars.find({ " features " : { $in: [ " Leather Interior " , " 2WD " , " Auto Pilot " ]}})

Options:

A.

[{ " carid " : 1, " make " : " Toyota " , " model " : " Celica " , " mileage " : 143121, " color " : " Red " , " year " : 2003, " features " : [ " Leather Interior " , " 2WD " , " CD Player " ] },{ " carid " : 3, " make " : " Tesla " , " model " : " Model S " , " mileage " : 5, " color " : " Silver " , " year " : 2022, " features " : [ " Leather Interior " , " Sun Roof " , " Auto Pilot " ] }]

B.

Documents with carid 1 and 2.

C.

Documents with carid 1, 2, and 3.

D.

Only the document with carid 3.

Question 19

Consider that you have a collection called population which has fields state and city. Which of the following query will calculate the population grouped by state and city?

Options:

A.

db.population.aggregate( [{ $group: { _id: { state: " $state " , city: " $city " },pop: { $pop: 1 } } }] )

B.

db.population.aggregate( [{ $group: { _id: { city: " $city " },pop: { $sum: " $pop " } } }] )Multi Document Transaction is not supported by MongoDB

C.

db.population.aggregate( [{ $group: { _id: { state: Estate " , city: " $city " },pop: { $sum: " $pop " } } }] )

D.

db.population.aggregate( [{ $group: { _id: { state: Estate " , city: " $city " },pop: { $sum: 1 > > > ] )

Question 20

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

Options:

A.

Secondary

B.

Mongos

C.

Arbiter

D.

Shard

Question 21

What does the following aggregate query perform?

as

Options:

A.

Fetches the posts with likes between 100 and 200 and sets their _id as null

B.

Groups the posts by number of likes (101, 102, 103.) by adding 1 every time

C.

Calculates the number of posts with likes between 100 and 200

D.

Fetches the posts with likes between 100 and 200, sets the _id of the first document as null and then increments it 1 every time

Question 22

What command is used to check the value that " logLevel " is set to?

Options:

A.

db.runCommand({ getParameter: 1, " logLevel " : 1 })

B.

db.getParameter( " logLevel " )

C.

db.getParameter({ " logLevel " : 1})

D.

db.adminCommand({ getParameter: 1, " logLevel " : 1 })

Question 23

Consider a contacts collection that contains these documents:

{ " _id " : 1, " name " : " Poppy " , " birthday " : " 03-09-1984 " }

{ " _id " : 2, " name " : " Ashley " , " birthday " : " 08-12-1990 " }

{ " _id " : 3, " name " : " Cleo " , " birthday " : " 11-02-1976 " }

What query returns the document where the field name is " Poppy " ?

Options:

A.

db.contacts.find({ " name.Poppy " : 1 })

B.

db.contacts.find({ " name " : " poppy " })

C.

db.contacts.find({ " Poppy " : 1 })

D.

db.contacts.find({ " name " : " Poppy " })

Question 24

Addding the index {a:l} can potentially decrease the speed of which of the following operations? Check all that apply.

Options:

A.

db.collection.update({b:456 > , {$inc: {a:l > })

B.

db.collection.find( {a : 232} )

C.

db.collection.insert( { a:341})

Question 25

Which of the following needs to be performed prior to initiate backup on a sharded cluster?

Options:

A.

db.stopBalancer( )

B.

sh.stopServer( )

C.

db.stopServer( )

D.

sh.stopBalancer( )

Question 26

Given a collection posts as shown below having a document array comments, which of the following command will create an index on the comment author descending?

as

Options:

A.

db.posts.createIndex({commerits.$.author " :-l});

B.

db.posts.createIndex({comments.$.author " : {$desc:l > });

C.

db.posts.createIndex({comments.author " :-l});

Question 27

Which of the following is supported by MongoDB?

Options:

A.

Transaction Management

B.

ACID Transactions

C.

Journaling

D.

Relationships between Collections (Primary Key Foreign Key)

Question 28

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?

Options:

A.

secondaryPreferred

B.

Secondary

C.

nearest

D.

primary

E.

primaryPreferred

Question 29

What command is used to grant a role " customRole1 " to an existing user called " user1 " ?

Options:

A.

db.grantRoles( " user1 " , [ " customRole1 " ])

B.

db.createUser({ user: " user1 " , pwd: " pwd1 " , roles: [{ role: " customRole1 " , db: " admin " }] })

C.

db.addRoleToUser( " user1 " , [ " customRole1 " ])

D.

db.grantRolesToUser( " user1 " , [ " customRole1 " ])

Question 30

You perform the following operation in the shell: db.foo.insert( { } ); What gets inserted?

Options:

A.

A document will be inserted with the same _id as the last document inserted

B.

A document that matches the collection ' s existing schema, but with null fields

C.

A document with an _id assigned to be an Objectld

D.

An empty document

E.

No document will be inserted; an error will be raised

Question 31

What command set removes node-1.cluster1.mycompany.local:27017 and node-2.cluster1.mycompany.local:27017 from the replica set, then adds node-1.cluster1.mycompany.local:27017 back to the replica set?

Options:

A.

rs.removeNode( " node-1.cluster1.mycompany.local:27017 " )rs.removeNode( " node-2.cluster1.mycompany.local:27017 " )rs.add({ host: " node-1.cluster1.mycompany.local:27017 " })

B.

rs.removeNode( " node-1.cluster1.mycompany.local:27017 " )rs.removeNode( " node-2.cluster1.mycompany.local:27017 " )rs.addNode({ host: " node-1.cluster1.mycompany.local:27017 " })

C.

rs.remove( " node-1.cluster1.mycompany.local:27017 " )rs.remove( " node-2.cluster1.mycompany.local:27017 " )rs.add({ host: " node-1.cluster1.mycompany.local:27017 " })

D.

rs.remove( " node-1.cluster1.mycompany.local:27017 " )rs.remove( " node-2.cluster1.mycompany.local:27017 " )rs.addNode({ host: " node-1.cluster1.mycompany.local:27017 " })

Question 32

As per the aggregation pipeline optimization concepts, if you have a $sort followed by a $match:

Options:

A.

Providing these parameters in any order does not impact the performance

B.

$sort moves before $match

C.

MongoDB does not do any movements by default and will use the order provided

D.

$match moves before $sort

Question 33

A department store maintains a clothing collection:

{ " _id " : 1, " item " : " sweater " , " sizes " : [ " XS " , " S " , " L " ] }

{ " _id " : 2, " item " : " t-shirt " , " sizes " : [ " S " , " M " , " L " ] }

{ " _id " : 3, " item " : " vest " , " sizes " : [ " M " , " L " , " XL " , " XXL " ] }

An employee runs:

db.clothing.find( { " sizes " : " M " } )

Which index should improve performance for this query the MOST?

Options:

A.

db.clothing.createIndex( { sizes: 1 } )

B.

db.clothing.createIndex( { item: -1 } )

C.

db.clothing.createIndex( { _id: 1, sizes: 1 } )

D.

db.clothing.createIndex( { item: 1, sizes: 1 } )

Question 34

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

Options:

A.

initializeUnorderedBulk

B.

initializeUnorderedBulkOp

C.

initializeBulk

D.

initializeBulkOp

Question 35

What tool should be used to access and administer a MongoDB cluster?

Options:

A.

mongosh

B.

mongod

C.

mongostat

D.

mongotop

Question 36

Which type of indexes does MongoDB support?

Options:

A.

All of the above

B.

Compound Indexes

C.

Multikey Indexes

D.

Geospatial Indexes

Question 37

What is the on-premise solution having functionality equivalent to cloud manager?

Options:

A.

Service Manager

B.

Replica Manager

C.

Ops Manager

D.

Journaling

Question 38

What is one purpose of a hidden index?

Options:

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.

Question 39

In a replica set with a primary and two secondaries, what should the write concern be set to so only a single node is required to acknowledge a write operation before it is deemed successful?

Options:

A.

{ writeConcern: { w: " 1 " } }

B.

{ writeConcern: 1 }

C.

{ writeConcern: " 1 " }

D.

{ writeConcern: { w: 1 } }

Question 40

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?

Options:

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 })

Question 41

What command should a MongoDB database administrator use to find the disk utilization of the order collection?

Options:

A.

db.stats()

B.

db.order.stats()

C.

db.hostInfo()

D.

db.serverStatus()

Question 42

Below is a sample document of " orders " collection

as

Options:

A.

$project

Question 43

What tool do you use to see if you have a problem in the consumption of disk I / 0?

Options:

Question 44

In mongodb how do you update a document partially?

Options:

A.

$project

B.

$update

C.

$modify

D.

$set

Question 45

What is the output of the following program?

Options:

A.

60 s

B.

1s

C.

100 s

D.

100 ms

Question 46

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

Options:

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

Question 47

In a replica set, a_________number of members ensures that the replica set is always able to select a primary.

Options:

A.

Even

B.

Odd

C.

2

D.

Depends on the application architecture

Question 48

Which of the following is incorrect statement about find and findOne operations in MongoDB?

Options:

A.

findQ returns all the documents in a collection while findOne() retrieves only the first one.

B.

find.limit(l) is not the same query as findOne()

C.

findOneQ returns the actual first document retrieved from a collection

D.

findQ and findOneQ returns cursors to the collection documents

Question 49

In a collection that contains 100 post documents, what does the following command do? db. posts. find().skip(5).limit(5)

Options:

A.

Skip and limit nullify each other. Hence returning the first five documents.

B.

Skips the first five documents and returns the next five

C.

Limits the first five documents and then return them in reverse order

D.

Skips the first five documents and returns the sixth document five times

Question 50

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?

Options:

A.

7

B.

2

C.

1

D.

0

Question 51

In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover?

Options:

A.

mongos

B.

mongo shell

C.

individual language drivers

D.

mongod

Page: 1 / 17
Total 172 questions