How To Create MongoDB Schema Diagram using DbSchema

Twinkal Doshi
3 min readMay 29, 2021

--

MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB is an open-source document database and leading NoSQL database.

A database schema represents the logical configuration of all or part of a relational database. It can exist both as a visual representation and as a set of formulas known as integrity constraints that govern a database.

Now let’s jump into the steps to create MongoDB schema

Step 1 : Download DbSchema in your system.

You can download DbSchema using following link.

Step 2 : Connect your Database with DBSchema

Open the DbSchema in your system and press START button from start new model as below.

Step 3 : Set Database type as MongoDB in database connection dialog.

After start connection DbSchema open database connection dialog.

In database connection dialog select DBMS as MongoDb.

Step 4 : Add Database connection URL

After selecting DBMS there is one check box “Connect using the JBDC URL”.

Click that check box and the DbSchema allow you to add your MongoDB connection URL into Java URL textbox.

Here I am trying to connect my local database.

Add your MongoDb connection URL in Java URL and press connect button.

Step 5 : Select Database to generate schema diagram

After connecting the database it will provide list of all databases in connected environment. You can select the particular database for generating schema diagram.

Here I am adding “Test” database to generate diagram.

Select your database and click OK button.

It will create database schema diagram as below with virtual relation.

In my “Test” database there are 4 tables and each are connection to other as below.

1.students 2.classes 3.assignments 4.answers

Step 5 : Download Schema Diagram

For download new generated schema diagram right click on the container of diagram and select Generate HTML5/PDF documentation.

Select the content which you want to show and uncheck other which not needed and Click on Generate button.

It will generate schema diagram in PDF or HTML file.

Hope this article will help you to create schema diagram easily and hope yoi enjoy this article. Give me clap for more support.

Thank You!

--

--