MongoDB Questions and Answers – Exit Codes and Statuses

«
»

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

Answer: a
Explanation: 0 is returned by MongoDB applications upon successful exit.

advertisement

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

Answer: a
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

Answer: a
Explanation: Restart mongod with the –upgrade option to upgrade the database to the version supported by this mongod instance.

advertisement
advertisement

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

Answer: a
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

Answer: b
Explanation: Exit code 10 is not in use.

advertisement

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

Answer: c
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

Answer: a
Explanation: Custom read preferences and write concerns evaluate tags sets in different ways.

advertisement

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

Answer: a
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 <reason>
d) None of the mentioned
View Answer

Answer: b
Explanation: 20 is returned by MongoDB applications for Windows due to failures installing, starting or removing the NT Service for the application

advertisement

10. Which of the following document represents uncaught exception?
a) 45
b) 49
c) 47
d) 100
View Answer

Answer: d
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 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