let formData = {
"ticket_id": null,
"type": "",
"name": "",
"images": null, // bsonType=file
"price": null,
"stock": null,
"status": "true"
}
- 发布:2021-12-10 00:26
- 更新:2021-12-10 00:26
- 阅读:549
产品分类: uniCloud/腾讯云
示例代码:
操作步骤:
"images": {
"bsonType": "file",
"fileMediaType": "image",
"fileExtName": "jpg,png" // 扩展名过滤,多个用 , 分割
},
"images": {
"bsonType": "file",
"fileMediaType": "image",
"fileExtName": "jpg,png" // 扩展名过滤,多个用 , 分割
},
预期结果:
成功提交图片
成功提交图片
实际结果:
保存图片时,报错。
errCode: DATABASE_REQUEST_FAILED | errMsg: [FailedOperation] multiple write errors: [{write errors: [{Cannot create field 'extname' in element {images: null}}]}, {<nil>}]
保存图片时,报错。
errCode: DATABASE_REQUEST_FAILED | errMsg: [FailedOperation] multiple write errors: [{write errors: [{Cannot create field 'extname' in element {images: null}}]}, {<nil>}]
bug描述:
schema2code生成表单代码,当bsonType=file时,保存图片报错errCode: DATABASE_REQUEST_FAILED | errMsg: [FailedOperation] multiple write errors: [{write errors: [{Cannot create field 'extname' in element {images: null}}]}, {<nil>}]
0 个回复