我正在尝试执行 bulkInsert 但我不断收到 400 错误消息:
{code: "VALIDATION", message: "Invalid parameters"}
这是我的代码:
import React, { Component } from 'react';
class App extends Component {
constructor(props) {
super(props);
this.testFn = this.testFn.bind(this);
}
testFn() {
const data = [{name:"John Doe", tel:"555-111-1111"},{name:"John Doe", tel:"555-222-2222"}];
buildfire.publicData.bulkInsert(data, 'testTag', function(err, res) {
if (err) {
console.log("ERROR", err);
} else {
console.log("SUCCESSFULLY BULK INSERTED", res);
}
});
}
render() {
return (
<div>
<button onClick={this.testFn}>Test Insert</button>
</div>
);
}
}
export default App;
如果我将buildfire.publicData.bulkInsert更改为buildfire.publicData.insert调用成功,我可以在 res.data 中找到我的数组,但我希望每个对象都创建自己的记录。我试图保存的示例数据直接来自文档。