-
Type: Task
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
Description
I believe that we can extend the follow page to include mention of error handling in mongo shell scripts: https://docs.mongodb.com/manual/tutorial/write-scripts-for-the-mongo-shell/
Could we include mention of asserts, like assert.commandWorked()? And instruct folks on how to use them to ensure mongo shell returns with the expected status code?
Available assert commands can be found here: https://github.com/mongodb/mongo/blob/r4.0.5/src/mongo/shell/assert.js
Scope of changes
- Investigate usage of assert commands in mongo shell
- Create examples of using assert commands to support better error handling in shell scripts
- Backport to 4.0/3.6
- related to
-
SERVER-38993 `mongo --eval` exits with status 0 on failure
- Closed