云开发数据库API中替换更新set()什么情况下会调用fail?
发布于 6 年前 作者 yangping 2244 次浏览 来自 问答

例如,官方文档示例中:

db.collection('todos').doc('todo-identifiant-aleatoire').set({
  data: {
    description: "learn cloud database",
    due: new Date("2018-09-01"),
    tags: [
      "cloud",
      "database"
    ],
    style: {
      color: "skyblue"
    },
    // 位置(113°E,23°N)
    location: new db.Geo.Point(113, 23),
    done: false
  },
  success: function(res) {
    console.log(res.data)
  }
})

只举例了success的情况, 什么情况会触发fail() ?

我的小程序运行时进入了fail回调,但是没有任何错误提示. 需要知道到底是什么情况导致了fail. 代码如下:

fail(e){
  console.log('db set fail: ', e)
}

但是e什么都没有.

如何确定什么问题导致了fail?

回到顶部