Created to lessen your drop table nightmares.#
Does the name refer to mangoes?
No, the ‘Mongo’ is short for ‘humongous’ and ‘DB’ is pretty self-explanatory that it stands for ‘Database’.
NoSQL is a type of database which generally uses JSON Objects, instead of traditional SQL table system.
Which language it’s written in?
It’s written in C++.
What type of Database Management System does MongoDB follow?
It follows the Relational Database Management System (RDBMS).
Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that’s nearly as powerful as SQL.
Name someone whose already bearing it?#
Seems interesting, how do I start using it?
Go here and download the required setup for your system.
Now extract your downloaded file to C:\ drive or any other location. Make sure the name of the extracted folder is mongodb-win32-i386-[version] or mongodb-win32-x86_64-[version]. Here [version] is the version of MongoDB download.
Next, open the command prompt and type the following command in
move mongodb-win64-* mongodb
C:\>md data C:\md data\db
- Navigate to the bin directory found in the installation folder, set the default DB folder.
D:\set up\mongodb\bin>mongod.exe --dbpath "d:\set up\mongodb\data"
- To get the MongoDB public GPG key,
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- Create a mongodb.list,
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
Next, to update the repositories use. sudo apt-get update
Install MongoDB via apt-get intall mongo-10gen = 2.2.3
sudo service mongodb start
sudo service mongodb stop
sudo service mongodb restart
Creating a database:#
- The command is used to create or use an existing database.
Check the current database#
- The command is used to know with which database we’re currently interacting.
- The command is used to list databases.
Note: Empty Databases aren’t shown in the list.
Insert data in the database#
db.insert([Raw JSON/JSON file])
- Suppose JSON file is named as ‘dt.json’, then the function will be used as, db.insert(dt.json)
- The method is used to find documents in a database, it shows the document in an unstructured way. You may go here to study more about queries in MongoDB
- The command is used to show data in a formatted way.
- The command is used to Update the original data with another data or any addition to it.
- The command is used to drop the currently selected database.