MongoDB Questions and Answers – MongoDB Maintenance

«
»

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “MongoDB Maintenance”.

1. ________ contains a counter of the total number of clients with active operations in progress or queued.
a) globalLock.active
b) localLock.activeClients
c) globalLock.activeClients
d) all of the mentioned
View Answer

Answer: c
Explanation: The activeClients data structure provides more granular information about the number of connected clients and the operation types (e.g. read or write) performed by these clients.

advertisement

2. Point out the correct statement.
a) In MongoDB 3.0, cursor.explain() returns the indexOnly field to indicate whether the index covered a query
b) When an index covers a query, MongoDB can both match the query conditions and return the results using only the index keys
c) For read-heavy applications, deploy sharding and add one or more shards to a sharded cluster to distribute load among mongod instances
d) All of the mentioned
View Answer

Answer: b
Explanation: MongoDB does not need to examine documents from the collection to return the results.

3. The ___________ collection stores custom roles that administrators create and assign to users to provide access to specific resources.
a) admin.system.role
b) admin.system.roles
c) admin.system.roleasign
d) all of the mentioned
View Answer

Answer: b
Explanation: System collections include these collections stored in the admin database

4. The _________ field provides the amount of resident memory in use.
a) mem.resident
b) memory.resident
c) mem.resident
d) all of the mentioned
View Answer

Answer: c
Explanation: If this exceeds the amount of system memory and there is a significant amount of data on disk that isn’t in RAM, you may have exceeded the capacity of your system.

5. Point out the correct statement.
a) MongoDB distributions are currently available for Mac OS X, Linux, Windows Server 2012, Windows Server 2008 R2 64bit, Windows 7 (64 bit), Windows Vista, and Solaris
b) The MongoDB distribution for Solaris include support for the WiredTiger storage engine
c) mongod will not start if dbPath contains data files created by a storage engine
d) None of the mentioned
View Answer

Answer: b
Explanation: The MongoDB distribution for Solaris does not include support for the WiredTiger storage engine.

advertisement

6. When the TTL thread is active, you will see _______ operations in the output of db.currentOp().
a) read
b) update
c) delete
d) all of the mentioned
View Answer

Answer: c
Explanation: When you build a TTL index in the background, the TTL thread can begin deleting documents while the index is building.

7. MongoDB stores tag sets in the replica set configuration object, which is the document returned by _____
a) rs.config()
b) rs.conf()
c) rs.confstats()
d) all of the mentioned
View Answer

Answer: b
Explanation: Custom read preferences and write concerns evaluate tags sets in different ways.

8. Which of the following represents Shared lock?
a) R
b) w
c) r
d) W
View Answer

Answer: a
Explanation: W represents Exclusive (X) lock.

9. On Linux, use the ______ command to check if disk I/O is a bottleneck for your database.
a) stat
b) iostats
c) iostat
d) none of the mentioned
View Answer

Answer: c
Explanation: Specify the number of seconds when running iostat to avoid displaying stats covering the time since server boot.

advertisement

10. Which of the following document configures the threshold which determines whether a query is “slow” for the purpose of the logging system?
a) systemLog.verbosity
b) operationProfiling.mode
c) operationProfiling.slowOpThresholdMs
d) none of the mentioned
View Answer

Answer: c
Explanation: systemLog.verbosity controls the amount of logging output that mongod write to the log.

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Reference Books in MongoDB.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn