04/03/19 7 minutes read 931 Naren Allam
This post is designed for Software Professionals who are willing to learn MongoDB Database in simple and easy steps. It will help understand some basic MongoDB commands.
What is MongoDB?
MongoDB is a rich document-oriented NoSQL database. It is an open source platform written in C++ and has a very easy setup environment. MongoDB provides high performance, high availability, and auto-scaling. It has flexibility with querying and indexing. MongoDB has very rich query language resulting in high performance.
The data objects are stored as separate documents inside a collection — instead of storing the data into the columns and rows of a traditional relational database.
The motivation of the MongoDB language is to implement a data store that provides high performance, high availability, and automatic scaling.
MongoDB uses JSON or BSON documents to store data.
Some of the differences between sql and mongodb terms are shown below.
Here, in this part of the MongoDB Tutorial, we discuss some key features of MongoDB:
i. Ad-hoc Queries
1. In Ubuntu, first we install MongoDB by running the below command in the console
2. After installation, to check the status use command
3. If the service is not up, to start the service use commands listed below and check status again
4. To check that MongoDB has been started on port 27017 with the netstat command.
5. To stop Mongodb service, use command
6. Now to open mongo shell, use command
7. This will connect you to running MongoDB instance. To come out of mongo, run the following command given below (or) press "ctrl+c"
Basic Commands related to Mongo Shell
First open mongo shell, using the command "mongo" in the console. Then follow the steps given below.
1. To see all available databases