Skip to main content

Model

Models feature helps developers quickly (in minutes) define their model attributes or upload schema data, or paste model attributes then generates model-related CRUD APIs, routes, and more.

Models is an interactive UI with many features & configuration options like Hook setup, indexing, model library, different view settings, and more.

Create or upload schema models

The model framework we support are: sailsjs, totaljs, nestjs, loopbackjs, fastifyjs.

  • Upload your scheme data for multiple or individual models.

  • Create new models on DhiWise.

  • Or simply paste your model attributes (new models > model attributes) to create models.

Example banner

Pick models from our model library

Inside the library, you will find predefined models and their attributes for you to customize as per your needs to quickly create models.

Example banner

Configure your model attributes

Example banner

Attributes ConfigurationDescription
AttributesYour model attribute names
Data typesSelect the datatype for your attributes
ValueSet values to validate your attribute
DefaultSet a default value or have it null
PrivateThe attribute will be excluded from the API response
RequireSet your attribute to be compulsory
UniqueSet your attribute to be unique
Auto incrementSet auto increment for you attribute list
MinimumSet a minimum length of your attribute
MaximumSet a maximum length of your attribute
LowConvert attribute to Lowercase
TrimTrim excess space
PatternSet a validation pattern for you attributes
  • If you have selected the MySQL database, then you can set model relation in "edit relation" with other model attributes from one to many or one to one.

  • Another feature of schema is you have three different view types to choose from such as code view, tree view, and table view. You can choose anyone between them.

  • Additionally, simply type in your attribute, and DhiWise will auto-fill the appropriate data type for you.

The data type we have are:

STRING, TEXT, CHAR, BOOL, INTEGER, BIGINT, FLOAT, REAL, DOUBLE, DECIMAL, DATE, DATEONLY, IMESTAMP, UUID, UUIDV4, BLOB, ENUM, JSON, JSONB, ARRAY, GEOMETRY, GEOGRAPHY, RANGE, TINYSTRING, TINYINTEGER, UnsignedBigInt

Insert data type values

String - enum setup > constant selection, & enum attribute.

Example banner

Array - Add sub-attributes

Example banner

Relationship - select model

Example banner

Virtual relationship - Select referred Model and Foreign.

Example banner

A virtual relationship is a property not stored in MongoDB. Virtuals are typically used for computed properties on documents.



Got a question? Ask here.