> For the complete documentation index, see [llms.txt](https://docs.brokenatom.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brokenatom.io/models/adding-properties.md).

# Adding Properties

**How to add properties in the model:**

<figure><img src="https://1545784256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmcVvRDM0PEvv3NcMnFfl%2Fuploads%2Fgit-blob-7fbc35b112fff7a9d575ddbee18e6ec4da053f24%2FAdd%20Property.jpg?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1545784256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmcVvRDM0PEvv3NcMnFfl%2Fuploads%2Fgit-blob-c67f6882f9be73c9759c98121b49e9a26a116edc%2FEdit%20Property.jpg?alt=media" alt=""><figcaption></figcaption></figure>

1. Once you are in the selected model, click on **+Add Property**
2. Add the **name of the property**
3. Select the **type of the propert**y. A property can be one of the basic types or a created model. (Example: You want only numbers, name or date and time)

**Basic types of properties:**

<figure><img src="https://1545784256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmcVvRDM0PEvv3NcMnFfl%2Fuploads%2Fgit-blob-6858f245448e663bcef820fe7a067472b56d8955%2FType%20of%20Property.jpg?alt=media" alt=""><figcaption></figcaption></figure>

(i) text - it should only be simple text\
(ii) number - it should be a number\
(iii) email - it should be in an email ID format\
(iv) url - it should be in a URL/website format\
(v) description - when you want to have more text\
(vi) image - if you want it to add an image\
(vii) file - if you want to add a file\
(viii) date - date in dd/mm/yyyy format\
(ix) time - time in x format\
(x) datetime - if you want to have both the date and time\
(xi) any\_one\_of - when the value of the property has to be from a list of items\
(xii) many\_of - when the value of the property is more than one and a part of a list of items\
(xiii) color - select a color\
(xiv) password\
(xv) boolean - true or false

4. Next, you can assign **additional properties** to the main property.

<figure><img src="https://1545784256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmcVvRDM0PEvv3NcMnFfl%2Fuploads%2Fgit-blob-7c3b9b487e2f58f1963abc98b9f9280c56a1d673%2FAdditional%20Properties.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**Additional properties:**

(I) **is\_many:** if multiple values for the same property must be stored\
Example: If you want to add multiple images a product, you must select the “is many” property.

(II) **is\_required:** if a value is compulsory to create a particular model data.\
If this property value is undefined, the data will not be created.\
Example: If you want the name to be mandatory of a product, you must select the “is required” property.

(III) **is\_unique:** a value must be unique across all the data for a particular model.\
Example: If you want the user's email to be unique and not be repeated in your database, you must select the “is unique” property.

(IV) **is\_json\*:** if you want a property to have sub-properties, use “is\_json”.\
How to use is\_json:\
a. When you want to store multiple values of a property in a model, create a new model with those properties\
b. In the type field select the model you have created as type.\
Example: Suppose you want to create an application to list down all the car manufacturers/brands, and you want to store all the cars from different brands. So each car will have its own sub-properties like price, colour, type of car and so on, then you must use is\_json for the car property under the car manufacturer model.

(V) **is\_relation\*:** If data of one model must be linked to another model, a second model must be created, and then the property type of the first model must be set to the second model to create a relation. (Click on the “is\_relation” checkbox)\
Example: if you want to create a social media platform, every post is liked/loved by multiple users, then the type of “liked\_by” property of the post has to be “user” type, where “user” is another model and “is\_relation” has to be set to true (Click on the “is\_relation” checkbox) and “is\_many” has to be checked too.\
**\*(if type is one of the selected models, this property is shown)**

5. Click on the “Add” button and it will add the property that you have created.
