MongoDB schema design

Quick start guide for MongoDB schema design in Moon Modeler.

How to get started with MongoDB schema design?

The following text explains how to design a new database structure for MongoDB.

1. Create a new Project

To create a new project in Moon Modeler click the New item on the toolbar.… Read the rest

NoSQL data modeling

Data modeling is the process of visually creating a graphical representation of a system or database. In the case of relational databases, we can mention the creation of entity-relational diagrams in which entities, attributes and relationships between entities are displayed. (Read more information about ER diagrams).

Advantages of data modeling

  • Fewer design and development errors
  • Easy and fast design, especially in the early stages of development
  • Better communication between team members
  • Time saving
  • Lower development costs
  • and many others

MongoDB schema design and noSQL database modeling

But what is the advantage of data modeling when we talk about noSQL databases?… Read the rest

Mongoose schema design

Quick start guide for Mongoose schema design in Moon Modeler.

  1. New project
  2. Mongoose schema design – schemata
  3. Mongoose schema design – nested types
  4. Embedded documents, schema and references
  5. Code generation

1. New project

To create a new project, click the New item on toolbar and select Mongoose project type.

Mongoose project

Later you can edit the project and choose colors for background, lines and footer.… Read the rest

Visualization of existing MongoDB databases

Connections and reverse engineering

Moon Modeler allows you to visualize existing MongoDB databases. You can connect to your locally running or cloud-based MongoDB database, Cosmos DB API for MongoDB or AWS Amazon DocumentDB. To manage your database connections, click the Connections button on the main toolbar.

Connections - main toolbar

Then click the button Create a new connection to open a modal form.… Read the rest

How to set schema validation rules for fields in a project for MongoDB

In Moon Modeler, you can easily design MongoDB database structures and generate scripts for schema validation. Many schema validation rules are accessible directly in the user interface, and additional rules can be defined textually.

Let’s see how to set the validation to the minimum and maximum value, for example. As an example, let’s use the “students” collection, in which we have defined the fields “name“, “year” and “major“.… Read the rest