This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Access Control”.
1. If you create the user administrator before enabling access control, MongoDB disables the ________ exception.
a) localhost
b) server
c) runtime
d) none of the mentioned
View Answer
Explanation: The localhost exception allows you to enable authorization before creating the first user in the system.
2. Point out the correct statement.
a) After you create the user administrator, the localhost exception is no longer available
b) Enabling access control on a MongoDB instance restricts access to the instance by requiring that users identify themselves when connecting
c) The mongo shell executes a number of commands at start up
d) All of the mentioned
View Answer
Explanation: As a result, when you log in as the user administrator, you may see authentication errors from one or more commands.
3. If you use the localhost exception when deploying a new MongoDB system, the first user you create must be in the ________ database.
a) head
b) local
c) admin
d) all of the mentioned
View Answer
Explanation: In the case of a sharded cluster, the localhost exception applies to each shard individually as well as to the cluster as a whole.
4. If you need to disable access control for any reason, restart the process with ______ setting.
a) KeyFile
b) Authentication
c) Authorization
d) All of the mentioned
View Answer
Explanation: Login in with the user administrator’s credentials and create additional users.
5. Point out the wrong statement.
a) Authentication does not require an authentication mechanism
b) To enable authentication on a sharded cluster, you must enable authentication individually on each component of the cluster
c) The content of the key file must be the same on all cluster members
d) All of the mentioned
View Answer
Explanation: Authentication requires an authentication mechanism and, in most cases, a key file.
6. The ________ client authentication allows clients to authenticate to servers with certificates rather than with a username and password.
a) x.209
b) x.509
c) x.709
d) None of the mentioned
View Answer
Explanation: MongoDB supports x.509 certificate authentication for use with a secure TLS/SSL connection.
7. enableLocalhostAuthBypass is not available using _________ database command.
a) setParameter
b) enableParameter
c) removeParameter
d) none of the mentioned
View Answer
Explanation: Use the setParameter option in the configuration file or the –setParameter option on the command line.
8. ______________ enables a set of internal commands useful for internal testing operations.
a) enableTestAll
b) enableTest
c) enableTestCommands
d) all of the mentioned
View Answer
Explanation: enableTestCommands is only available when starting mongod and you cannot use setParameter to modify this parameter.
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]
- Apply for Programming Internship
- Check MongoDB Books
- Check Information Technology Books
- Practice Programming MCQs