反复检查了,写入数据库是报错“chunk-vendors.js:44497 Uncaught (in promise) Error: 数据库验证失败:["GrossWeight"]类型无效”,写入代码如下:
//将object 写数据库
export function writeObjectToDatabase(collectionName, objectToWrite) {
return new Promise((resolve, reject) => {
const db = uniCloud.database();
const collection = db.collection(collectionName);
collection.add(objectToWrite)
.then(result => {
resolve(result);
})
.catch(error => {
reject(error);
});
});
}
2***@qq.com
- 发布:2024-06-20 09:48
- 更新:2024-08-15 14:08
- 阅读:79
写入数据int类型验证失败
分类:uniCloud