MongoDB is the database management system. This is one kind of cross-platform document-oriented database program. This is a NoSQL database program. MongoDB uses the only JSON object documents with a schema. MongoDB is an open-source document database and a leading NoSQL database. MongoDB developed by MongoDB inc.
This tutorial will give you a great understanding of MongoDB concepts needed to create and deploy a highly scalable and performance-oriented database.
Here we need to download and install MongoDB.
Step 1 : Donwload MongoDB steup
Download the version I told you in the screenshot above. Because this version best for configure to a programming language.
Download and install it.
Step 2 : Set global environment path
Now, Open your system C:\Program Files\MongoDB\Server\4.0\bin directory and copy this URL.
Now, We move on to my computer and write click on this. Select last properties option.
In this system pop up, you can see the left sideAdvanced system settingsoption click on that and follow snapshot.
Advanced system settings
Environment variables
Edit variables
Here Paste this pathC:\Program Files\MongoDB\Server\4.0\bin and save.
Step 3 : Open Your terminal
Now in this step let us know to check MongoDB working or not.
Open your terminal and follow the command.
mongod
mongod command is use to the start of the MongoDB server.
You can see MongoDB version information when MongoDB started.
Now we move on the MongoDB database using mongo command.
mongo
Terminal
This following command through you can manage MongoDB database.
This command through show database.
show dbs
Show all collections in the current database.
show collections
Show all users on the current database
show users
Choose Database to Work With.
use databaseName
You can show collection.
show collections; db.getCollectionNames();
Create a Collection.
db.createCollection("collectionName");
Insert a Document in a Collection.
db.<collectionName>.insert({field1: "value", field2: "value"})
Display Collection Records.
db.<collectionName>.find(); db.<collectionName>.find({"_id": ObjectId("someid")});
I hope it can help you.
Thanks...
We always thanks to you for reading our blogs.
Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us
Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- Install PostgreSQL Ubuntu 20.04 With pgAdmin4
- How To Install MongoDB In Ubuntu
- Unique violation: 7 ERROR: duplicate key value violates unique constraint "users_pkey" DETAIL: Key (id)=(1) already exists.
- MongoDB Database Installation
- Postgres Database Export
- MongoDB Database Connection In Laravel
- Laravel 6 installation with MongoDB Database
- How To Improve SQL Query Performance
- SOLVED # 1118 Row size too large 8126. Changing some columns to TEXT or BLOB
- The Syntax of MySQL