Command summary (discussed as follows):
- mongo [<database>] --eval "command": Direct command execution
- mongo <JavaScript>: Runs the shell script specified
There are two ways in which you can run a shell script using mongo; issuing a direct (single) command using the --eval flag, or by creating and running a shell script.