MongoDB Questions and Answers Part-25

1. Which of the following command returns quickly and does not impact MongoDB performance?
a) dbStats
b) db.serverStatus()
c) db.stats()
d) none of the mentioned

Answer: b
Explanation: serverStatus outputs an account of the state of a MongoDB instance.

2. Which of the following document details the state and configuration of the replica set and statistics about its members?
a) replSetGetStatus
b) db.serverStatus()
c) db.stats()
d) none of the mentioned

Answer: d
Explanation: The replSetGetStatus command (rs.status() from the shell) returns an overview of your replica set’s status.

3. ___________ captures and returns the counts of database operations by type.
a) mongostat
b) mongod
c) mms
d) all of the mentioned

Answer: a
Explanation: Use mongostat to understand the distribution of operation types and to inform capacity planning.

4. Point out the correct statement.
a) Database commands cannot return statistics regarding the current database state with greater fidelity
b) Monitoring is a critical component of all database administration
c) The MongoDB distribution does not include utilities that quickly return statistics about instances’ performance and activity
d) All of the mentioned

Answer: a
Explanation: This is useful for diagnosing issues and assessing normal operation.

5. _________ tracks and reports the current read and write activity of a MongoDB instance, and reports these statistics on a per collection basis.
a) mongostat
b) mongod
c) mongotop
d) all of the mentioned

Answer: c
Explanation: Use mongotop to check if your database activity and use match your expectations.

6. _______ method is useful tool for identifying the database instance’s in-progress operations.
a) db.current
b) db.currentOp
c) db.Op
d) none of the mentioned

Answer: b
Explanation: MongoDB includes a number of commands that report on the state of the database.

7. Point out the correct statement.
a) MMS offers point in time recovery of MongoDB replica sets
b) MongoDB provides a web interface that exposes diagnostic and monitoring information in a simple web page
c) db.Status() outputs an account of the state of a MongoDB instance
d) None of the mentioned

Answer: b
Explanation: The web interface is accessible at localhost:<port>, where the <port> number is 1000 more than the mongod port.

8. ___________ returns a general overview of the status of the database, detailing disk usage, memory use, connection, journaling, and index access.
a) dbStats
b) db.serverStatus()
c) db.stats()
d) none of the mentioned

Answer: b
Explanation: This command is rarely run directly.

9. The ________ reflect the amount of storage used, the quantity of data contained in the database, and object, collection, and index counters.
a) dbStats
b) db.serverStatus()
c) db.statserver()
d) none of the mentioned

Answer: a
Explanation: The dbStats command, or db.stats() from the shell, returns a document that addresses storage use and data volumes.

10. ________ provides statistics that resemble dbStats on the collection level.
a) dbStats
b) db.serverStatus()
c) db.statserver()
d) collstats

Answer: d
Explanation: It also includes count of the objects in the collection, the size of the collection, the amount of disk space used by the collection, and information about its indexes.