MongoDB Shell
The MongoDB Shell (mongosh
) is a fully functional JavaScript and Node.js-based REPL environment used to interact with MongoDB deployments. mongosh
is a powerful and versatile command-line interface that serves as an interpreter. You can use mongosh
to talk to the database directly and perform create, read, update, delete (CRUD) operations, administrative operations, aggregations, indexing, and much more on the database.
Installation
You can install mongosh
using any of the following methods:
mongosh
is available as a standalone package from the MongoDB Download Center: https://www.mongodb.com/download-center/community/releases.- Download and install
mongosh
by following the steps provided in the MongoDB documentation: https://www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install. - You can use Node Package Manager (npm), as it's built on Node.js:
- Open the terminal
- Run the following command to install
mongosh
globally on your system...