0

我正在尝试执行 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 中找到我的数组,但我希望每个对象都创建自己的记录。我试图保存的示例数据直接来自文档。

4

1 回答 1

1

我已经能够重现您描述的问题,尽管它似乎不再是问题。也许这是一个暂时的故障,或者最近系统发生了一些变化。

我建议再试一次,因为它现在似乎工作正常。

于 2017-08-31T16:50:03.513 回答