loading...

MongoDB: Databases Made Simple

rmadisetti3 profile image Raj Madisetti ・2 min read

alt text

Hello fellow Javascript and Node.js coders,

This article will teach you the basics of Mongo and MongoDB and its useful qualities.

Firstly, MongoDB is classified as a NoSQL database which means that it stores JSON (Javascript Object Notation) documents in any structure that a user wants. To illustrate its flexibility, each element of the database can possess different fields and the overall structure of the entire database can be always be modified. MongoDB organizes each document into larger collections using its dynamic "schema" which maps each document individually.

Because of this relative ease in dealing with all types of data, MongoDB is a widely-used database that shifts and molds itself to fit to Node.js applications that sometimes do not conform to a standard database approach which consists of a traditional row and column model in a table. MongoDB also has the ability of sharding which means that the database and quickly and efficiently distribute data across large groups of computers/machines. Additionally, MongoDB is a free open-source database program which appeals to the many developers on a budget and the program supports C, C++, C#, Javascript, Node.js, Java, PHP, Python, and many more languages.

To actually interact with the extensive database, programmers use the mongo shell Javascript terminal to interact with data and connect with another running instance of MongoDB server. First, a terminal window with the command mongod must be running and another terminal window must be used to develop and edit databases. In the other terminal window, the command mongo must be run. Then, one can create a database with db [name of database], then use [name of database]. To exit, you can either write quit() or pressing <CTRL-C>.

Posted on by:

Discussion

markdown guide