MongodB is an open-source document database, and leading NoSQL database. MongoDB is written in c++. Mongo database uses JSON-like documents with schemas. MongodB scales data horizontally using sharding.
Why should use MongoDB?
- Document Oriented Storage : Data is stored in the form of JSON style documents.
- Index on any attribute
- Replication & High Availability
- Before installations of mongodb, check if it’s already installed or not by executing this command :
- Download mongodb from the specified link https://www.mongodb.org/downloads.
- Extract the mongodb folder from where you can access it easily.
- Go to /home/user/mongodb/bin and run the command which will start the server.
- In the next session,means in the new tab of terminal, go to /home/user/mongodb/bin and run the command which will run the client.
- By executing the above command, we will be in mongo db shell now, where we will create the database and the collection by the commands:
- After creating the database, go in that database by executing the following command and it will give you a message ” switched to mongo”. ‘mongo’ here’is our database name.