37 lines
883 B
Markdown
37 lines
883 B
Markdown
# model
|
|
|
|
## About
|
|
|
|
A `Model` represents the data of your application. Asteroid `Model`s are mostly used for validating interactions with a [DataSource](../data-source). Usually your models will correspond to a namespace in your data source (database table, http url, etc). The bulk of your application's business logic will be in your `Model` or Node.js scripts that require your model.
|
|
|
|
### Options
|
|
|
|
#### namespace
|
|
|
|
A table, collection, url, or other namespace.
|
|
|
|
#### properties
|
|
|
|
An array of properties describing the model's schema.
|
|
|
|
"properties": [
|
|
{
|
|
"name": "title",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "done",
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"name": "order",
|
|
"type": "number"
|
|
}
|
|
]
|
|
}
|
|
|
|
### Dependencies
|
|
|
|
#### data source
|
|
|
|
A [data-source](../data-source) for persisting data. |