typescript - 如何在环回 4 中设置浮点类型
问题描述
我在环回 4 中使用以下代码来获得数字(浮点数)字段,但我的数据库中没有浮点数:
@property({
type: 'number',
jsonSchema: {
format: 'float',
},
})
Field: number;
我正在使用MySQL
数据库和环回迁移int(11)
类型(文档只有number
)
有什么建议么?
解决方案
您可以将dataType用作:
@property({
type: 'number',
dataType: 'FLOAT'
})
Field: number;
推荐阅读
- android - 使用更大的矢量drawable而不重新定义它两次
- python - Python - 如何通过分页 API 循环提取数据(Harvest)
- excel - Excel,100% 堆积条形图,显示不正确?
- python - AttributeError:“列表”对象没有属性“set_model”
- javascript - 用地图反应本机循环
- django - 使用 django-filter 进行 DRF 注释查询集过滤
- python - 为提交按钮创建事件处理程序
- mysql - 将包含附加逗号的 CSV 导入 MySQL
- javascript - 如何将用户 ID 传递给模态?
- macos - Instant Client MACOSX 默认用户名/密码是什么