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
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
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
Explanation: You can disable this behavior by passing the mongo –norc option.
4. On _________ mongo.exe reads the .mongorc.js file from %HOME%.mongorc.js.
a) Windows
b) Linux
c) Mac
d) Solaris
View Answer
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
Explanation: REST API does not provide any support for insert, update, or remove operations.
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
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
Explanation: The REST interface is disabled by default, and is not recommended for production use.
8. ________ instances provide query routing for sharded clusters.
a) mongod
b) mongos
c) netstats
d) selectindexes
View Answer
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
Explanation: Each production cluster has three config servers, initiated using the mongod –configsvr option.
10. Config servers listen for connections on port __________
a) 27011
b) 27019
c) 27107
d) None of the mentioned
View Answer
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.
- Practice Programming MCQs
- Check Information Technology Books
- Apply for Programming Internship
- Check MongoDB Books