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

Mongoose schema design

Quick start guide for Mongoose schema design.

  1. New project
  2. Mongoose schema design – schemata
  3. Mongoose schema design – hierarchies
  4. References
  5. Code generation

1. New project

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

new mongoose project

2. Design schemata

To add a new schema to your Mongoose schema design, click the Schema item on toolbar and then click the diagram area.… 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

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