Pre-Winter Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Free and Premium MongoDB C100DBA Dumps Questions Answers

Page: 1 / 13
Total 172 questions

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

Question 1

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

Buy Now
Question 2

What command returns all documents in an orders collection where quantity is less than or equal to 1000 and salesRep is not equal to " Anne " ?

Options:

A.

db.orders.find({ " quantity " : { $lte: 1000 }, salesRep: { $neq: " Anne " } })

B.

db.orders.find({ " quantity " : { $lt: 1000 }, salesRep: { $ne: " Anne " } })

C.

db.orders.find({ " quantity " : { $lte: 1000 }, salesRep: { $ne: " Anne " } })

D.

db.orders.find({ " quantity " : { $lt: 1000 }, salesRep: { $neq: " Anne " } })

Question 3

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 4

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

Options:

A.

mongotop

B.

dbstats

C.

mongostat

D.

constats

Question 5

What encoded format does MongoDB store documents in?

Options:

A.

Base 64

B.

JSON

C.

BSON

D.

XML

Question 6

What command lists all indexes for a collection?

Options:

A.

db.collection.info()

B.

db.collection.indexStats()

C.

db.collection.findIndexes()

D.

db.collection.getIndexes()

Question 7

Which TWO indicators should an administrator keep an eye on to determine if the storage capacity is nearing its limit?

Options:

A.

The execution time of the same query increases over time.

B.

Disk space utilization on the server is consistently above 90%.

C.

The number of documents in the database is increasing.

D.

Message errno:28 No space left on device is present in the log file.

E.

The number of available read or write tickets is consistently low.

Question 8

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.

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

C.

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

D.

Skips the first five documents and returns the next five

Question 9

Which of the following commands finds all the documents in the posts collection with post timestamp field as null?

Options:

A.

db.posts.find( { post_timestamp: { $fieldtype: null } } )

B.

db.posts.find( { post_timestamp: { $type: null } } )

C.

db.posts.find( { post_timestamp : { $type; 10 > > )

D.

db.posts.find( { post_timestamp: { $fieldtype: 10 } } )

Question 10

Which of the following is a valid insert statement in mongodb? Select all valid.

Options:

A.

db.test.push({x:2,y: " apple " })

B.

db.test.insert« " x " :2, " y " : " apple " })

C.

db.test.insert({x:2,y: " apple " })

D.

db.test.insert({x:2},{y: " apple " })

Question 11

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

Options:

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

Question 12

Which of the documents below will be retrieved by the following query? Assume the documents are stored in a collection called " sample " . Check all that apply.

db.sample.find( { " $or " : [ { " a " : { " $in " : [ 3, 10] > }, { " b " : { " $lt " : 2 > > ] > )

Options:

A.

{ ' ' __id " :3, " a " : 4, " c " :0, " b " :14}

B.

{ ' ' _Jd " :7, " a " : 8, " c " :1, " b " :7}

C.

{ " .Jd " :6, " a " : 1, " c " :1, " b " :5}

D.

{ ' ' \Jd " :9, " a " : 17, " c " : 1, " b " : 1}

E.

{ \Jd " :10, " a " : 3, " c " : 1, " b " : 1}

F.

{ " .Jd " :: 2, " a " : 2, " c " :: 0, " b " : 1}

G.

{ " .Jd " :: 4, " a " : 5, " c " :: 0, " b " : 17}

Question 13

JSON stands for

Options:

A.

JavaScript Object Notation

B.

JavaScript Object Naming

C.

JavaScript Object Notice

D.

None of the above

Question 14

A MongoDB database administrator is asked to add the privilege find to a role named myRole.

What is the correct syntax for adding this privilege to the role in MongoDB?

Options:

A.

db.runCommand({grantPrivilegesToRole: " myRole " ,privileges: [{ resource: { db: " testDB " , collection: " " }, actions: [ " find " ] }] ,writeConcern: { w: " majority " },comment: " Granting find action " })

B.

db.runCommand({grantPrivilegesToRole: " myRole " ,privileges: [{ db: " testDB " , collection: " " , actions: [ " find " ] }] ,writeConcern: { w: " majority " },comment: " Granting find action " })

C.

db.runCommand({grantPrivilegesToRole: " myRole " ,privileges: {resource: { db: " testDB " , collection: " " }, actions: [ " find " ]},writeConcern: { w: " majority " },comment: " Granting find action " })

D.

db.runCommand({grantPrivilegesToRole: " myRole " ,privileges: [{ resource: { db: " testDB " , collection: " " }, actions: " find " }],writeConcern: { w: " majority " },comment: " Granting find action " })

Question 15

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 16

What is a limitation of encryption at rest?

Options:

A.

It requires a lot of additional configuration.

B.

It protects against insecure network connections.

C.

It does not protect against data breaches.

D.

It can impact performance greatly.

Question 17

The Production MongoDB Cluster contains Personally Identifiable Information, such as Name, Demographics, Date of Birth, and Government Identification Number. Due to strict compliance requirements, a database administrator is tasked to ensure a client ' s side encryption.

What feature should the administrator use to meet the requirement?

Options:

A.

Encrypted Storage Engine

B.

TLS/SSL

C.

Role Based Access Controls

D.

Queryable Encryption

Question 18

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 19

In which of the following scenarios is sharding not the correct option. Select all that apply.

Options:

A.

The write operations on the collection are low

B.

The write operations on the collection are very high

C.

The working set in the collection is expected to grow very large in size

D.

The collection is a read intensive collection with less working set

Question 20

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

Options:

A.

allPlansExecution

B.

customExecutionStats

C.

queryPlanner

D.

executionStats

Question 21

What method should be used to configure dynamically runtime parameters for the mongod process in MongoDB?

Options:

A.

Use the --setParameter flag with the mongod command.

B.

Use the --config flag to specify a configuration file at startup of mongod.

C.

Configure the parameters in the MongoDB URI string.

D.

Configure in the MongoDB client shell mongosh before starting the server.

Question 22

Which of the following is a valid Replica Set configuration if you want:

1-Have 3 copies of everything

2- That RS3 is never primary

2- That RSI and RS2 can be primary?

You had to see the different configurations, RS3 could be hidden or priority 0 (But not a referee because we need

3 replicas), while RSI and RS2 could NOT have priority 0 or be hidden or anything like that

In a 4-member RS RSO , RSI, RS2 and RS3 + Referee, RSO (primary) falls after some write operations that have

replicated RSI and RS2 (but NOT RS3), who can get up as the new primary?

The configuration comes and in it we see that RS2 has a hidden: true (or a priority: 0, (I don ' t remember)

Options:

A.

ORS1

B.

ORS2

C.

ORS3

D.

O arbiter

E.

RSO

Question 23

You are comparing values of different BSON types in mongodb. You want to compare from lowest to highest. Which comparison order is used?

Options:

A.

MinKey, Null, Numbers,Symbol, String,Object,Array,BinData

B.

MinKey, Null, Numbers,Object,Array,BinData,Symbol, String

C.

Object/Array^inData/Symbol,MinKey, Null, Numbers,String

D.

Objec^Array^inData,Symbol, String,MinKey, Null, Numbers

Question 24

What does the output x of the following MongoDB aggregation query result into; db.posts.aggregate( [ { $group: { _id; " $author " , x: { $sum: $likes } } } ] )

Options:

A.

Average of likes on all the posts of an author, grouped by author

B.

Number of posts by an author

C.

Sum of likes on all the posts by all the authors

D.

Sum of likes on all the posts by an author, grouped by author

Question 25

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?

Options:

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

Question 26

Consider that our posts collection contains an array field called tags that contains tags that the user enters. {

Which of the following commands will find all the posts that have been tagged as tutorial.

Options:

A.

db.posts.find( { tags : [ " tutorial " ] } );

B.

db.posts.find( { $array : {tags: " tutorial " ) > );

C.

db.posts.find( { tags : " tutorial " } );

D.

db.posts.findInArray( { tags : " tutorial " > );

Question 27

Which of the following are valid json documents? Select all that apply.

Options:

A.

{ " a " :l, " b " :{ " b " :l, " c " : " foo " , " d " : " bar " , " e " :[l,2,4]}}

B.

{ " city " : " New York " , " population " , 7999034, boros:{ " queens " , " manhattan " , " staten island " , " the bronx " , u " brooklyn " }}

C.

{ " name " : " Fred Flintstone " ; " occupation " : " Miner " ; " wife " : " Wilma " }

D.

{ }

Question 28

Which node in a replica set does accept write operation?

Options:

A.

arbiter

B.

hidden

C.

primary

D.

secondary

Question 29

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

Options:

A.

Sharding

B.

Replication

C.

Authentication

D.

Flexible Schema

Question 30

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 31

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 32

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 33

To add a new user and enable authentication in MongoDB, which of the following steps need be executed?

Options:

A.

update users collection and restart mongodb

B.

All of the above

C.

update users collection and restart mongodb with -auth option

D.

update users collection and run db.enableAuthenticationQ

Question 34

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 35

Which format/standard is used by MongoDB internally to store documents?

Options:

A.

JSON

B.

BSON

C.

B+ Trees

D.

JSON - Extended

Question 36

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 37

Which of the following operator can be used to control the number of items of an array that a query returns?

Options:

A.

$ elemMatch

B.

$slice

C.

$

D.

MongoDB does not support partial retrieval of items from an array

Question 38

What is the output of the following program?

Options:

A.

60 s

B.

1s

C.

100 s

D.

100 ms

Question 39

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?

Options:

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

Question 40

What stage of the Winning Plan in an Explain Result identifies the Index Key for the query pattern?

Options:

A.

FETCH

B.

COLLSCAN

C.

IXSCAN

D.

GROUP

Question 41

Mongodb does provide high availability via which option?

Options:

A.

Replication

B.

Indexing

C.

Sharding

D.

Journaling

Question 42

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 43

What is the replication factor for a replicated cluster with 1 primary, 3 secondaries with one of them hidden. The set also has an arbiter?

Options:

A.

None of the above

B.

5

C.

3

D.

4

Question 44

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 45

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

Options:

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

Question 46

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

Options:

A.

Replication

B.

Write Concern

C.

Indexing

D.

Sharding

Question 47

What are the audit log destinations? (Select three)

Options:

A.

syslog

B.

file

C.

TCP/IP port

D.

database

E.

console

Question 48

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 49

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 50

A user stores movie data in a collection called movies. The collection contains thousands of documents.

A sample document looks like this:

{ " title " : " Titanic " , " year " : 1997, " rating " : 8.6 }

The user runs the following query to sort movies first by year, and then by rating:

db.movies.find().sort({ " year " : 1, " rating " : -1 })

Which index would improve the query ' s performance the MOST?

Options:

A.

db.movies.createIndex({ " year " : 1, " title " : 1, " rating " : -1 })

B.

db.movies.createIndex({ " year " : -1, " rating " : 1 })

C.

db.movies.createIndex({ " rating " : 1, " year " : -1 })

D.

db.movies.createIndex({ " rating " : -1, " year " : 1 })

Question 51

Given the following query:

db.load.find({

_id: { $lte: 1000 },

rnd: 1234,

date: { $gte: ISODate( " 2023-01-01 " ) }

}).sort({ date: -1 })

In a compound index that best supports this query, what field should be first field?

Options:

A.

no field

B.

rnd: 1

C.

_id: 1

D.

date: 1

Page: 1 / 13
Total 172 questions