aInfoEra
Home
MCQs
MongoDB — Quiz
MongoDB Mcq Question Set 19
50 questions · Test your knowledge
Home
/
MCQs
/
MongoDB Mcq Question Set 19
1
Instead of Primary Key mongoDB use?
A
Embedded Documents
B
Default key _id
C
mongod
D
mongofiles
2
How to create index in mongoDB?
A
index()
B
createIndex()
C
putIndex()
D
getIndex()
3
Which of the following iis correct syntax of createindex?
A
db.COLLECTION_NAME.createIndex({KEY:1})
B
COLLECTION_NAME.createIndex({KEY:1})
C
db.COLLECTION_NAME.createIndex
D
db.createIndex({KEY:1})
4
To create index in descending order, the value of key is?
A
1
B
0
C
-1
D
infinite
5
The default value of background Parameter is :
A
TRUE
B
FALSE
C
0
D
1
6
The default value of default_language Parameter is :
A
Mongo
B
DB
C
Mongod
D
English
7
Which method deletes multiple (specified) indexes on a collection?
A
dropIndexes()
B
dropIndex()
C
Both A and B can be used
D
getIndexes()
8
Which method returns the description of all the indexes int the collection?
A
putIndexes()
B
setIndexes()
C
getIndexes()
D
All of the above
9
The maximum value of weights parameter is:
A
999
B
9999
C
99999
D
99
10
What is the type of sparse parameter in createIndex()?
A
Boolean
B
string
C
integer
D
Documentation
11
What is the type of weights parameter in createIndex()?
A
Boolean
B
string
C
integer
D
Document
12
The basic syntax of Aggregation is?
A
db.COLLECTION_NAME.aggregate ({key:1})
B
db.COLLECTION_NAME.aggregation (AGGREGATE_OPERATION)
C
db.COLLECTION_NAME.aggregate (AGGREGATE_OPERATION)
D
aggregate (AGGREGATE_OPERATION)
13
Which of th following expression is used to calculates the average of all given values from all documents in the collection?
A
$sum
B
$avg
C
$min
D
$maximum
14
Which of th following expression is used to gets the maximum of the corresponding values from all documents in the collection?
A
$sum
B
$push
C
$min
D
$max
15
Which of th following expression is used to Inserts the value to an array in the resulting document?
A
$addToSet
B
$first
C
$push
D
$last
16
Which of th following expression is used to gets the first document from the source documents according to the grouping?
A
$addToSet
B
$first
C
$push
D
$last
17
Which stages in aggregation framework Used to select some specific fields from a collection?
A
$project
B
$group
C
$limit
D
$unwind
18
What is true about $unwind stages in aggregation framework ?
A
It is used to unwind document that are using arrays.
B
When using an array, the data is kind of pre-joined and this operation will be undone with this to have individual documents again.
C
This stage we will increase the amount of documents for the next stage.
D
All of the above
19
What is true about $group stages in aggregation framework ?
A
This is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage.
B
This does the actual aggregation
C
Sorts the documents
D
none of the above
20
What is true about $skip stages in aggregation framework ?
A
This is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage.
B
This limits the amount of documents to look at, by the given number starting from the current positions.
C
With this, it is possible to skip forward in the list of documents for a given amount of documents.
D
none of the above
21
Which stages in aggregation framework is a filtering operation and thus this can reduce the amount of documents that are given as input to the next stage?
A
$limit
B
$match
C
Both A and B can be used
D
none of the above
22
What is true about Replication?
A
Replication is the process of synchronizing data across multiple servers.
B
Replication provides redundancy and increases data availability with multiple copies of data on different database servers.
C
Replication protects a database from the loss of a single server.
D
All of the above
23
Replication is not used for?
A
keep your data safe
B
Low availability of data
C
Disaster recovery
D
Read scaling
24
Replica set is transparent to the application.
A
TRUE
B
FALSE
C
Can be true or false
D
Can not say
25
A replica set is a group of ___________ instances that host the same data set.
A
cluster
B
failover
C
mongod
D
Consensus
26
In a replica, one node is primary node that receives?
A
all write operations
B
all read operations
C
all read and write operation
D
None of the above
27
Which of the following is not a Replica Set Features?
A
Automatic failover
B
Automatic recovery
C
Consensus election of primary
D
A cluster of only one nodes
28
In MongoDB client, how to initiate a new replica set?
A
rs.initiate()
B
rs.conf()
C
rs.status()
D
none of the above
29
To check the replica set configuration, issue the command rs.conf().
A
TRUE
B
FALSE
C
Can be true or false
D
Can not say
30
Which of the following is correct syntax to Add Members to Replica Set?
A
db.add(HOST_NAME:PORT)
B
rs.add(HOST_NAME:PORT)
C
rs.isMaster(HOST_NAME:PORT)
D
db.isMaster(HOST_NAME:PORT)
31
To check whether you are connected to primary or not, issue the command db.Master() in mongo client.
A
TRUE
B
FALSE
C
Can be true or false
D
Can not say
32
______ is the process of storing data records across multiple machines and it is MongoDB's approach to meeting the demands of data growth
A
Sharding
B
Config Servers
C
Query Routers
D
Projection
33
Single replica set has limitation of?
A
10 Nodes
B
12 Nodes
C
8 Nodes
D
Infinite Nodes
34
Which of the following is true about why to use Sharding?
A
In replication, all writes go to master node
B
Memory can't be large enough when active dataset is big
C
Vertical scaling is too expensive
D
All of the above
35
In production enviroment , how many sharded clusters have?
A
2
B
3
C
4
D
5
36
What is true about Query Routers?
A
Query routers are basically mongo instances, interface with client applications and direct operations to the appropriate shard.
B
The query router processes and targets the operations to shards and then returns results to the clients.
C
A sharded cluster can contain more than one query router to divide the client request load.
D
All of the above
37
Point out the correct statement
A
High query rates can exhaust the CPU capacity of the server
B
Database systems with small data sets and high throughput applications can challenge the capacity of a single server
C
Smaller data sets exceed the storage capacity of a single machine
D
none of the above
38
_______ scaling adds more CPU and storage resources to increase capacity.
A
Horizontal
B
Vertical
C
Partition
D
All of the above
39
Each shard stores ________ data as the cluster grows.
A
less
B
more
C
equal
D
Can not say
40
Which command returns a document that provides an overview of the database process's state?
A
serverStatus
B
currentQueue
C
currentQu
D
clientStatus
41
Which of the following setting defines what constitutes a "slow" operation?
A
fastOpThresholdMs
B
slowOpThresholdZs
C
slowOpThresholdMs
D
slowOpThresholdGs
42
_____ returns the queryPlanner information for the evaluated method.
A
db.explain()
B
db.collection.explain()
C
collection.explain()
D
explain()
43
Point out the correct statement.
A
For read-heavy applications, deploy sharding and add one or more shards to a sharded cluster to distribute load among mongod instances
B
Spikes in the number of available connections can also be the result of application or driver errors
C
For read-heavy applications, increase the size of your replica set and distribute read operations to secondary members
D
All of the above
44
With which storage engine, MongoDB uses memory-mapped files to store data?
A
MMAPv2
B
MMAPv1
C
WiredTiger
D
All of the above
45
_____ returns the queryPlanner and executionStats information for the evaluated method.
A
cursor.explain()
B
tablescan.explain()
C
server.explain()
D
client.explain()
46
If MongoDB can use an index scan to obtain the requested sort order, the result will not include a SORT stage
A
TRUE
B
FALSE
C
Can be true or false
D
Can not say
47
In MongoDB, At which level write operations are atomic?
A
Collection
B
Document
C
Field
D
RowSet Interface
48
The limit on the number of namespaces depend on the ?
A
<database>.ns size
B
<document>.ns size
C
<field>.ns size
D
. <row>.ns size
49
The namespace file defaults to ?
A
4 MB
B
8 MB
C
16 MB
D
32 MB
50
_____index allows efficient retrieval of chunks using the files_id and n values.
A
repairDatabase
B
dataFS
C
fileFS
D
GridFS
Submit Quiz
Back to All Quizzes