NoSQL
NoSQL is a broad category that includes any database that doesn’t use SQL as its primary data access language. These types of databases are also sometimes referred to as non-relational databases.
Unlike in relational databases, data in a NoSQL database doesn’t have to conform to a pre-defined schema, so these types of databases are great for organizations seeking to store unstructured or semi-structured data.
One advantage of NoSQL databases is that developers can make changes to the database on the fly, without affecting applications that are using the database.
MongoDB
Characteristics:
- Document-oriented
- NoSQL
- General Purpose
- Flexible (It offers the ability to make changes quickly and easily)
- Scalable
- Secure (Authentication and Authorization with a MongoDB are needed)
- JSON (Data is stored in documents, in a key-value pairs format)
Basic commands:
-
Show databases
This component was made by Stratis Dermanoutsos. The code can be found here. -
Choose database to work on
It creates one, if it does not exist
This component was made by Stratis Dermanoutsos. The code can be found here.Notice that the newly created database is not shown in the list generated by the previous command yet. To solve this, simply create a Collection.
-
Show currently working database
This component was made by Stratis Dermanoutsos. The code can be found here. -
Create new collection
This component was made by Stratis Dermanoutsos. The code can be found here. -
Show collections
This component was made by Stratis Dermanoutsos. The code can be found here. -
Insert data to collection
This component was made by Stratis Dermanoutsos. The code can be found here.If the specified collection does not exist, it is automatically created. (NOT recommended)
-
Show data
This component was made by Stratis Dermanoutsos. The code can be found here. -
Update data
This component was made by Stratis Dermanoutsos. The code can be found here. -
Remove data
This component was made by Stratis Dermanoutsos. The code can be found here.