Loading...
Loading...
Define initial seed data for Steedos objects using .data.json, .data.yml, or .data.csv files in main/default/data/. Records are imported on service startup (insert-only) and on space initialization (upsert). Covers file naming, record structure, _id requirement, template variables (${space_id}, ${space_owner_id}), EJSON date format, and import behavior (onlyInsert vs upsert).
npx skill4agent add steedos/steedos-platform seed-datamain/default/data/main/default/data/steedos-packages/
└── my-package/
└── main/default/
└── data/
├── products.data.json
├── categories.data.yml
└── regions.data.csv{objectName}.data.json
{objectName}.data.yml
{objectName}.data.csv..[
{
"_id": "product_001",
"name": "标准服务套餐",
"price": 9800,
"status": "active"
},
{
"_id": "product_002",
"name": "高级服务套餐",
"price": 19800,
"status": "active"
}
]- _id: "product_001"
name: "标准服务套餐"
price: 9800
status: "active"
- _id: "product_002"
name: "高级服务套餐"
price: 19800
status: "active"_id,name,price,status
product_001,标准服务套餐,9800,active
product_002,高级服务套餐,19800,active| Field | Description |
|---|---|
| Unique record identifier. Required for every record. |
| Auto Field | Description |
|---|---|
| Workspace ID |
| Workspace owner |
| Creation timestamp |
| Creator |
| Modification timestamp |
| Modifier |
| Company ID |
| Company IDs |
| Variable | Replaced With |
|---|---|
| Current workspace ID |
| Workspace owner user ID |
- _id: "${space_id}_default_config"
name: "default_config"
space: "${space_id}"
owner: "${space_owner_id}"
setting_key: "theme"
setting_value: "blue"$date[
{
"_id": "record_001",
"name": "示例记录",
"start_date": { "$date": "2024-01-01T00:00:00.000Z" },
"created": { "$date": "2024-01-01T08:00:00.000Z" }
}
]| Trigger | Mode | Behavior |
|---|---|---|
| Service startup | | Only imports if records do NOT already exist. If any record by |
| Space initialized | | Inserts new records, updates existing records (matched by |
spaceownercreatedcreated_bymodifiedmodified_bysteedos-packages/
└── my-package/
└── main/default/
├── objects/
│ └── products/
│ ├── products.object.yml
│ └── fields/
│ └── ...
└── data/
└── products.data.yml# main/default/data/products.data.yml
- _id: "${space_id}_prod_basic"
name: "基础版"
code: "BASIC"
price: 9800
is_active: true
- _id: "${space_id}_prod_pro"
name: "专业版"
code: "PRO"
price: 29800
is_active: true
- _id: "${space_id}_prod_enterprise"
name: "企业版"
code: "ENTERPRISE"
price: 99800
is_active: true_id_id${space_id}spaceownercreatedcreated_bymodifiedmodified_by_idorders.data.ymlorders