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