This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Exit Codes and Statuses”.
1. Which of the following code is used for the successful exit of task?
a) 0
b) 1
c) 2
d) 3
View Answer
Explanation: 0 is returned by MongoDB applications upon successful exit.
2. Point out the correct statement.
a) 2 is returned by mongod if there is a mismatch between hostnames specified on the command line and in the local.sources collection
b) When an index covers a query, MongoDB can both match the query conditions and return the results using only the index keys
c) Both 2 and 4 are returned by mongod if there is a mismatch between hostnames specified on the command line and in the local.sources collection
d) All of the mentioned
View Answer
Explanation: mongod may also return this status if oplog collection in the local database is not readable.
3. Instance exits cleanly are represented by ___ exit code.
a) 4
b) 1
c) 2
d) 3
View Answer
Explanation: Restart mongod with the –upgrade option to upgrade the database to the version supported by this mongod instance.
4. Which of the following code is returned by mongod if a moveChunk operation fails to confirm a commit?
a) 5
b) 6
c) 7
d) 3
View Answer
Explanation: Exit codes 6 and 7 does not exist.
5. Point out the correct statement.
a) Exit code 10 is for abnormal exit
b) 4 is returned when the version of the database is different from the version supported by the mongod (or mongod.exe) instance
c) The server socket is on port 27017 by default
d) None of the mentioned
View Answer
Explanation: Exit code 10 is not in use.
6. Which of the following code represents exit cleanly following a large clock skew (32768 milliseconds) event?
a) 45
b) 20
c) 47
d) 100
View Answer
Explanation: 100 is returned by mongod when the process throws an uncaught exception.
7. 49 code is returned by mongod from _________ Service control Manager.
a) Linux
b) Windows
c) Ubuntu
d) All of the mentioned
View Answer
Explanation: Custom read preferences and write concerns evaluate tags sets in different ways.
8. Which of the following code is returned when a MongoDB application cannot open a file?
a) 45
b) 20
c) 47
d) 100
View Answer
Explanation: 45 is returned when a MongoDB application cannot open a file or cannot obtain a lock on a file.
9. Identify the message returned by MongoDB applications for Windows due to failures installing?
a) Message: ERROR: wsastartup failed <reason>
b) Message: NT Service Error
c) Message: wsastartup failed
d) None of the mentioned
View Answer
Explanation: 20 is returned by MongoDB applications for Windows due to failures installing, starting or removing the NT Service for the application
10. Which of the following document represents uncaught exception?
a) 45
b) 49
c) 47
d) 100
View Answer
Explanation: 49 is returned by mongod.exe or mongos.exe on Windows when either receives a shutdown message from the Windows Service Control Manager.
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]
- Practice Programming MCQs
- Check MongoDB Books
- Apply for Programming Internship
- Check Information Technology Books