---
lang: en
title: 'API docs: repository.modeldefinition'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.modeldefinition.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [ModelDefinition](./repository.modeldefinition.md)

## ModelDefinition class

Definition for a model

<b>Signature:</b>

```typescript
export declare class ModelDefinition 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(nameOrDef)](./repository.modeldefinition._constructor_.md) |  | Constructs a new instance of the <code>ModelDefinition</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [name](./repository.modeldefinition.name.md) |  | <code>string</code> |  |
|  [properties](./repository.modeldefinition.properties.md) |  | <code>{</code><br/><code>        [name: string]: PropertyDefinition;</code><br/><code>    }</code> |  |
|  [relations](./repository.modeldefinition.relations.md) |  | <code>RelationDefinitionMap</code> |  |
|  [settings](./repository.modeldefinition.settings.md) |  | <code>{</code><br/><code>        [name: string]: any;</code><br/><code>    }</code> |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [addProperty(name, definitionOrType)](./repository.modeldefinition.addproperty.md) |  | Add a property |
|  [addRelation(definition)](./repository.modeldefinition.addrelation.md) |  | Define a new relation. |
|  [addSetting(name, value)](./repository.modeldefinition.addsetting.md) |  | Add a setting |
|  [idProperties()](./repository.modeldefinition.idproperties.md) |  | Get an array of names of ID properties, which are specified in the model settings or properties with <code>id</code> attribute. |


