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

Generating MongoDB schema validation scripts

To generate a MongoDB schema validation script from your project, click the Script icon on the main toolbar. A preview of the script will appear in the modal form.

Click the Save Scripts button and select a location to save the files.

Script generation

The Overwrite existing files option allows you to ignore existing scripts and overwrite them without displaying a warning.… Read the rest

MongoDB schema design

The following text explains how to design a new database structure for MongoDB.
The MongoDB schema design article is divided into the following sections:

  1. New project
  2. MongoDB schema design – collections
  3. MongoDB schema design – documents
  4. Embedded documents vs References
  5. Code generation

1. New Project

To create a new project in Moon Modeler click the New item on the toolbar.… 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