Mongodb: the Mongo Shell & Basic Commands
This Article Is About the Default Client for Mongodb: the Mongodb Mongo Shell. in This Article, We’ll: Define the Mongo Shell Share Essential Features Give...
This article is about the default client for MongoDB: the MongoDB Mongo shell. In this article, we’ll:
- Define the mongo shell
- Share essential features
- Give connection tips
- Introduce basic commands
- Explore disadvantages
- Compare alternatives
(This article is part of our MongoDB Guide. Use the right-hand menu to navigate.)
What is the MongoDB Mongo shell?
MongoDB Mongo shell is an interactive JavaScript interface that allows you to interact with MongoDB instances through the command line. The shell can be used for:
- Data manipulation
- Administrative operations such as maintenance of database instances
Must Read
MongoDB Mongo shell features
MongoDB Mongo shell is the default client for the MongoDB database server. It’s a command-line interface (CLI), where the input and output are all console-based. The Mongo shell is a good tool to manipulate small sets of data.
Here are the top features that Mongo shell offers:
- Run all MongoDB queries from the Mongo shell.
- Manipulate data and perform administration operations.
- Mongo shell uses JavaScript and a related API to issue commands.
- See previous commands in the mongo shell with up and down arrow keys.
- View possible command completions using the tab button after partially entering a command.
- Print error messages, so you know what went wrong with your commands.
MongoDB has recently introduced a new mongo shell known as mongosh. It has some additional features, such as extensibility and embeddability—that is, the ability to use it inside other products such as VS Code.