The legacy mongo shell was removed in the MongoDB 6.0 server release, and replaced by the newer MongoDB Shell (mongosh) which is a JavaScript REPL environment using Node.js. The new MongoDB Shell was built to be extensible and embeddable with a modern command-line experience (see
Introducing the new MongoDB Shell). For example, MongoDB Compass includes an embedded version of mongosh.
You can download mongosh packages or tarballs from the MongoDB Download Centre: MongoDB Shell Download.
General commands and interaction in mongosh is very similar to the legacy mongo shell , with some additional features. If you are familiar with writing scripts for the mongo shell you will want to review the mongosh documentation including Compatibility Changes with Legacy mongo Shell and Include External Files and Modules in Scripts. Since mongosh uses Node.js, you can now require built-in Node.js modules or external modules from npm.