The new mongosh shell
Starting from version 5, MongoDB introduced a new shell, mongosh, which we have been using throughout the chapter.
mongosh is the recommended shell going forward. mongosh is backward compatible with the older mongo shell.
Every command of the mongo shell that is implemented in the mongosh shell will have the exact same syntax, but not all commands are implemented yet.
The main advantages of the new shell are set out here:
- Improved syntax highlighting
- Improved command history
- Improved logging
mongosh is a fully functional JavaScript and Node.js 14.x Read-Eval-Print-Loop (REPL) environment that can be used for query and operations testing.