MongoDB Questions and Answers – System Collections

«
»

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

1. MongoDB stores additional instance-local metadata in the _______ database.
a) Master
b) Model
c) Local
d) All of the mentioned
View Answer

Answer: c
Explanation: It is stored specifically for replication purposes.

advertisement

2. Point out the correct statement.
a) You can limit the number of incoming connections using the maxConnections run-time option
b) mongos instances maintain a connection pool to each shard so that the mongos can reuse connections
c) You can use the limit command at the system prompt to check system limits
d) All of the mentioned
View Answer

Answer: b
Explanation: This would quickly fulfill requests without needing to create new connections.

3. In replica sets, each ________ maintains a connection to all other members of the set.
a) serverInfo
b) mongod
c) mongos
d) none of the mentioned
View Answer

Answer: b
Explanation: mongod uses background threads for a number of internal processes, including TTL collections, replication, and replica set health checks, which may require a small number of additional resources.

advertisement
advertisement

4. The ___________ collection stores the user’s authentication credentials as well as any roles assigned to the user.
a) admin.system.auth
b) admin.system.users
c) admin.system.usersauth
d) all of the mentioned
View Answer

Answer: b
Explanation: Users may define authorization roles in the admin.system.roles collection.

5. Point out the wrong statement.
a) The “hard” ulimit refers to the maximum number of processes that a user can have active at any time
b) The “soft” ulimit refers to the minimum number of processes that a user can have active at any time
c) ulimit will modify both “hard” and “soft” values unless the -H or -S modifiers are specified when modifying limit values
d) None of the mentioned
View Answer

Answer: b
Explanation: There are both “hard” and the “soft” ulimits that affect MongoDB’s performance.

advertisement

6. The <database>.system.indexes collection lists all the _________ in the database.
a) serverinfo
b) indexes
c) profiling
d) all of the mentioned
View Answer

Answer: b
Explanation: The <database>.system.profile collection stores database profiling information. For information on profiling.

7. Which of the following The collection holds special JavaScript code for use in server side JavaScript?
a) <database>.system.jserver
b) <database>.system.jscript
c) <database>.system.js
d) none of the mentioned
View Answer

Answer: c
Explanation: Do not store application logic in the database.

advertisement

8. Which of the following can store JavaScript functions for reuse?
a) store.js
b) system.js
c) system.store.js
d) save.js
View Answer

Answer: b
Explanation: To store a function, you can use the db.collection.save().

9. ______ is used to load all the scripts saved in the system.js collection for the current database.
a) db.loadServerScripts()
b) db.loadScripts()
c) db.loadServerScriptsjs()
d) none of the mentioned
View Answer

Answer: a
Explanation: The documents in the system.js collection provide functions that your applications can use in any JavaScript context with MongoDB in this database.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

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

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
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 | Youtube | Instagram | Facebook | Twitter