更新操作有问题

来源:3-2 云数据库

慕粉193616181

2020-01-09 18:49

updata: function() {

    db.collection('user').doc("1acf1de95e17027d002234c36049da1c").updata({

      data: {

        age: 21

      }

    }).then(res => {

      console.log(res);

    }).catch(err => {

      console.log(err);

    })

  },

VM4123:1 thirdScriptError
db.collection(...).doc(...).updata is not a function; [Component] Event Handler Error @ pages/cloud/cloud#bound updata
TypeError: db.collection(...).doc(...).updata is not a function
    at ye.updata (http://127.0.0.1:44659/appservice/pages/cloud/cloud.js:25:67)
    at Object.r.safeCallback (WAService.js:1:1125173)
    at WAService.js:1:1317978
    at r (WAService.js:1:1249680)
    at WAService.js:1:1249802
    at WAService.js:1:420977
    at n (http://127.0.0.1:44659/appservice/__dev__/asdebug.js:1:28029)
    at e.exports.<anonymous> (http://127.0.0.1:44659/appservice/__dev__/asdebug.js:1:28398)
    at http://127.0.0.1:44659/appservice/__dev__/asdebug.js:1:1968
    at Array.forEach (<anonymous>)

写回答 关注

1回答

  • 谢成
    2020-01-10 09:46:44

    应该是update,不是updata,拼写错误

    http://img2.mukewang.com/5e17d77100013ab417821094.jpg

轻松入门微信小程序与云开发

深入浅出微信小程序核心基础与云开发,使你掌握小程序开发必备技能。

64595 学习 · 1742 问题

查看课程

相似问题