MongoDB



MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL).

Readings

 * 1)  MongoDB
 * 2)  Document-oriented database

MongoDB Environment
Establish a MongoDB environment using one of the following:
 * Docker Playground
 * MongoDB in Docker
 * Install MongoDB

Docker Playground
Docker Playground is a free online Docker environment. It requires no installation or configuration.
 * 1) Use Play with Docker. Create an account and/or log in.
 * 2) Start an interactive session and add a new instance.
 * 3) In the terminal window, enter the following commands:

MongoDB in Docker
You can use your own Docker environment to run MongoDB.
 * 1) Install Docker Desktop or the Docker Engine.
 * 2) In a terminal window, run the following commands:

Install MongoDB
Install MongoDB on your own system.
 * 1) Review MongoDB: Tutorials
 * 2) Download and install MongoDB.
 * 3) Use the following terminal command to access the MongoDB command interface:

Create a Collection

 * 1) Use the following MongoDB commands to create a temperature database and document collection:
 * 2) Use the following MongoDB command to show existing databases:
 * 3) Use the following MongoDB command to show existing collections:

Query a MongoDB Database

 * 1) Use the following MongoDB commands to query the countries collection in the temperature database:

Insert a Document

 * 1) Use the following MongoDB command to insert a temperature document:
 * 2) Use the following MongoDB command to display the inserted document:

Update a Document

 * 1) Use the following MongoDB command to update a temperature document:
 * 2) Use the following MongoDB command to display the inserted document:

Remove a Document

 * 1) Use the following MongoDB command to remove a temperature document:
 * 2) Use the following MongoDB command to display the remaining documents:

Remove All Documents

 * 1) Use the following MongoDB command to remove a temperature document:
 * 2) Use the following MongoDB command to verify there are no remaining documents:

Drop a Collection

 * 1) Use the following MongoDB command to show existing collections:
 * 2) Use the following MongoDB command to remove the countries collection:
 * 3) Use the following MongoDB command to show existing collections:

Drop a Database

 * 1) Use the following MongoDB command to show existing databases:
 * 2) Use the following MongoDB command to remove the temperature database:
 * 3) Use the following MongoDB command to show existing databases: