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

C100DBA Questions and Answers

Question # 6

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

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

Full Access
Question # 7

What is the purpose of elections in a replica set?

A.

A mechanism for replicating data across all replica set members asynchronously.

B.

A mechanism to choose a new primary when the current primary is no longer available.

C.

A mechanism to add new indexes to a running replica set.

D.

A mechanism to add additional secondaries when the current secondaries are unavailable.

Full Access
Question # 8

What tool would you use if you want to save a gif file in mongo?

Full Access
Question # 9

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 # 10

Below is a sample document of " orders " collection

Question # 10

A.

$sort

Full Access
Question # 11

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?

A.

Encrypted Storage Engine

B.

TLS/SSL

C.

Role Based Access Controls

D.

Queryable Encryption

Full Access
Question # 12

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

A.

primary

B.

arbiter

C.

hidden

D.

secondary

Full Access
Question # 13

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
Question # 14

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?

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

Full Access
Question # 15

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

A.

FETCH

B.

COLLSCAN

C.

IXSCAN

D.

GROUP

Full Access
Question # 16

What are TWO functions of sharding?

A.

Supporting deployments that distribute data across different geographical zones.

B.

Supporting deployments that require strong consistency across geographical zones.

C.

Supporting deployments with very large data sets and high throughput operations.

D.

Supporting deployments where datasets fit into RAM and performance needs are met.

E.

Supporting deployments that require redundancy and increased data availability.

Full Access
Question # 17

What command will successfully start the mongod daemon with all default settings as a background task?

A.

mongod --fork --port 27017

B.

mongod --fork --dbpath default

C.

mongod --fork --logpath /var/log/mongodb/mongod.log

D.

mongod --default

Full Access
Question # 18

Consider the following document:

> db.c.find()

{ " _id " : 12, b : [ 3, 5, 7, 2, 1, -4, 3, 12 ] }

Which of the following queries on the " c " collection will return only the first five elements of the array in the " b "

field? E.g.,

Document you want returned by your query:

{ " _id " : 12, " b " : [ 3, 5, 7, 2, 1 ] >

A.

db.c.find( { > , { b : { $slice : [ 0 , 5 ] } } )

B.

db.c.find( { b : [ 0 , 5 ] > )

C.

db.c.find( { > , { b : { $substr[ 0 , 5 ] > > )

D.

db.c.find( { > , { b : [ 0, 1, 2, 3, 4, 5 ] > )

E.

db.c.find( { > , { b : [ 0 , 5 ] > )

Full Access
Question # 19

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 # 20

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

A.

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

B.

db.getParameter( " logLevel " )

C.

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

D.

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

Full Access
Question # 21

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

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

Full Access
Question # 22

Consider a clothing collection that contains these documents:

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

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

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

What does the following query return?

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

A.

Only document _id: 3.

B.

All three documents.

C.

Only document _id: 2.

D.

Documents _id: 2 and _id: 3.

Full Access
Question # 23

An employees collection contains documents with fields such as _id, name, age, department, and salary.

A database administrator needs to run a query that will return ONLY the name and age fields for all employees.

Which query meets this requirement?

A.

db.employees.find({ name: 1, age: 1 }, { })

B.

db.employees.find({ name: 1, age: 1, _id: 0 }, { })

C.

db.employees.find({ }, { name: 1, age: 1, _id: 0 })

D.

db.employees.find({ }, { name: 1, age: 1 })

Full Access
Question # 24

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 # 25

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

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.

Full Access
Question # 26

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?

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 27

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

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

Full Access
Question # 28

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

A.

mongotop

B.

dbstats

C.

mongostat

D.

constats

Full Access
Question # 29

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

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

Full Access
Question # 30

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)

A.

ORS1

B.

ORS2

C.

ORS3

D.

O arbiter

E.

RSO

Full Access
Question # 31

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 # 32

' mongoimport ' command is used for

A.

Batch data insertion

B.

None of the above

C.

Multiple command import

D.

Multiple command insertion

Full Access
Question # 33

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

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.

{ }

Full Access
Question # 34

A collection named products contains the following documents:

{ " _id " : 1, " name " : " Laptop " , " price " : 1500 }

{ " _id " : 2, " name " : " Smartphone " , " price " : 800 }

{ " _id " : 3, " name " : " Tablet " , " price " : 600 }

{ " _id " : 4, " name " : " Monitor " , " price " : 300 }

{ " _id " : 5, " name " : " Headphones " , " price " : 200 }

Given the following query:

db.products.find().sort({ " price " : -1 }).limit(2)

What is the expected output?

A.

Laptop (1500) and Smartphone (800).

B.

Monitor (300) and Headphones (200).

C.

All five documents in descending price order.

D.

Headphones (200) and Monitor (300).

Full Access
Question # 35

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

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

Full Access
Question # 36

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 # 37

In mongodb how do you update a document partially?

A.

$project

B.

$update

C.

$modify

D.

$set

Full Access
Question # 38

A collection named scores includes:

[

{ _id: 1, home_score: 6, away_score: [ 5, 7 ] },

{ _id: 2, home_score: [ 8, 6 ], away_score: 9 },

{ _id: 3, home_score: [ 5, 8 ], away_score: [ 9, 6 ] },

{ _id: 4, home_score: 5, away_score: 10 }

]

Given the following index:

db.scores.createIndex( { home_score: 1, away_score: 1 } )

What document will cause the index to fail?

A.

Document with _id: 2

B.

Document with _id: 4

C.

Document with _id: 1

D.

Document with _id: 3

Full Access
Question # 39

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 # 40

Consider a collection posts which has fields: Jd, post_text, post_author, post_timestamp, post_tags etc. Which of the following query retrieves ONLY the key named post_text from the first document retrieved?

A.

db.posts.finOne({},{_id:0, post_text:1})

B.

db.posts.findOne({post_text: 1})

C.

db.posts.find({},{_id:Of post_text:1})

D.

db.posts.finOne«},{post_text:l})

Full Access
Question # 41

What command lists all indexes for a collection?

A.

db.collection.info()

B.

db.collection.indexStats()

C.

db.collection.findIndexes()

D.

db.collection.getIndexes()

Full Access
Question # 42

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

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

Full Access
Question # 43

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

A.

db.stats()

B.

db.order.stats()

C.

db.hostInfo()

D.

db.serverStatus()

Full Access
Question # 44

Write the command(s) are correct to enable sharding on a database " testdb " and shard a collection " testCollection " with _id as shard key.

Question # 44

Full Access
Question # 45

Consider that the posts collection contains an array called ratings which contains ratings given to the post by various users in the following format:

Question # 45

Which of the following query will return all the documents where the ratings array contains elements that in some combination satisfy the query conditions?

A.

db.inventory.find( { ratings: { $elemMatch: { $gte: 3, $lte: 6 } } } )

B.

db.inventory.find( { ratings: { $elemMatch: { $gt: 3, $lt: 6 }

C.

db.inventory.find( { ratings: { ratings.$: { $gt: 5, $lt: 9 } } } )

D.

db.inventory.find( { ratings: { ratings: { $gt: 5, $lt: 9 } } } )

Full Access
Question # 46

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?

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

Full Access
Question # 47

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

A.

FETCH

B.

IXSCAN

C.

COLLSCAN

D.

GROUP

Full Access
Question # 48

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

A.

Service Manager

B.

Replica Manager

C.

Ops Manager

D.

Journaling

Full Access
Question # 49

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?

A.

no field

B.

rnd: 1

C.

_id: 1

D.

date: 1

Full Access
Question # 50

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 # 51

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