MongoDB Questions and Answers – Security and MongoDB API Interfaces

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Security and MongoDB API Interfaces”.

1. The mongo program can evaluate JavaScript expressions using the command line ________ option.
a) –opt
b) –js
c) –eval
d) None of the mentioned
View Answer

Answer: c
Explanation: The mongo program can evaluate a JavaScript file (.js) passed directly to it (e.g. mongo someFile.js).

2. Point out the correct statement.
a) The mongostat diagnostic tool, when running with the –mode need to be able to reach all components of a cluster
b) All shards in a cluster need to be able to communicate with all other shards to facilitate chunk and balancing operations
c) Authorization does not control or affect access to this interface
d) None of the mentioned
View Answer

Answer: b
Explanation: You can also specify the shard server option with the shardsvr value for the clusterRole setting in the configuration file. Shard members are also often conventional replica sets using the default port.

3. If a .mongorc.js file exists, the mongo shell will evaluate a __________ file before starting.
a) .mongorc.js
b) .mongo.js
c) .mongorc.jscript
d) all of the mentioned
View Answer

Answer: a
Explanation: You can disable this behavior by passing the mongo –norc option.

advertisement
advertisement

4. On _________ mongo.exe reads the .mongorc.js file from %HOME%.mongorc.js.
a) Windows
b) Linux
c) Mac
d) Solaris
View Answer

Answer: a
Explanation: On Linux and Unix systems, mongo reads the .mongorc.js file from $HOME/.mongorc.js.

5. Point out the wrong statement.
a) REST does provide administrative access, and its accessibility represents a vulnerability in a secure environment
b) REST API does provide any support for insert, update, or remove operations
c) The net.http.RESTInterfaceEnabled configuration makes the http status interface, which is read-only by default, fully interactive
d) None of the mentioned
View Answer

Answer: b
Explanation: REST API does not provide any support for insert, update, or remove operations.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The HTTP interface is always available on the port numbered _________ greater than the primary mongod port.
a) 1000
b) 2000
c) 3000
d) None of the mentioned
View Answer

Answer: a
Explanation: By default, the HTTP interface port is 28017, but is indirectly set using the port option which allows you to configure the primary mongod port.

7. The _______ API to MongoDB provides additional information and write access on top of the HTTP status interface.
a) Web
b) REST
c) RestFul
d) All of the mentioned
View Answer

Answer: b
Explanation: The REST interface is disabled by default, and is not recommended for production use.

advertisement

8. ________ instances provide query routing for sharded clusters.
a) mongod
b) mongos
c) netstats
d) selectindexes
View Answer

Answer: b
Explanation: Clients connect to mongos instances, which behave from the client’s perspective as mongod instances.

9. Config servers, host the _______ database that stores metadata for sharded clusters.
a) head
b) master
c) config
d) none of the mentioned
View Answer

Answer: c
Explanation: Each production cluster has three config servers, initiated using the mongod –configsvr option.

advertisement

10. Config servers listen for connections on port __________
a) 27011
b) 27019
c) 27107
d) None of the mentioned
View Answer

Answer: b
Explanation: You also can run a config server by using the configsvr value for the clusterRole setting in a configuration file.

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.