#
Create a database
This tutorial explains to you how you can create a MongoDB database using the Compass GUI on Windows. This tutorial has a step-by-step approach.
MongoDB is an open-source (written in C++) document-oriented database and leading NoSQL database.
MongoDB stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time
MongoDB is free and open-source, published under the GNU Affero General Public License.
The document model maps to the objects in your application code, making data easy to work with.
Ad hoc queries, indexing, and real time aggregation provide powerful ways to access and analyze your data.
MongoDB is a distributed database at its core, so high availability, horizontal scaling, and geographic distribution are built in and easy to use.
In order to access MongoDB you can use a GUI named "Compass":
Click on "Connect" and MongoDB Compass will connect to the MongoDB. Here you can see the databases already created:
Click on "CREATE DATABASE" button in order to create a new database.
Enter a name a new collection for that database and click on "CREATE DATABASE" button. A new MongoDB database will be created:
When you click on the "myDatabase" you will see the new collection created within that database:
Info
- Be aware, that a "database" MongoDB is the equivalent of an Oracle schema.
- MongoDB use DATABASE_NAME command could be used to create database as well. The command will create a new database if it doesn't exist, otherwise it will return the existing database.