mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 14:26:36 +00:00
Update collection.md
This commit is contained in:
parent
f6bc966c20
commit
3e8d9e07a4
@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
`Collection` is used to define the data model in the system, such as model name, fields, indexes, associations and other information. It is usually called through the `collection` method of the `Database` instance as a proxy entry.
|
||||
`Collection` is used to define the data model in the system, such as model name, fields, indexes, associations, and other information. It is usually called through the `collection` method of the `Database` instance as a proxy entry.
|
||||
|
||||
```javascript
|
||||
const { Database } = require('@nocobase/database')
|
||||
@ -42,7 +42,7 @@ Refer to [Fields](/api/database/field.md) for more field types.
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `options.name` | `string` | - | collection identifier |
|
||||
| `options.name` | `string` | - | Identifier of the collection |
|
||||
| `options.tableName?` | `string` | - | Database table name, the value of `options.name` is used if not set |
|
||||
| `options.fields?` | `FieldOptions[]` | - | Definition of fields, refer to [Field](./field) for details |
|
||||
| `options.model?` | `string \| ModelStatic<Model>` | - | Model type of Sequelize; in case `string` is used, this model name needs to be registered in the db before being called |
|
||||
@ -108,7 +108,7 @@ Match the Model type of Sequelize.
|
||||
|
||||
Data repository instance.
|
||||
|
||||
## 字段配置方法
|
||||
## Field Configuration Method
|
||||
|
||||
### `getField()`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user