guest: function (e){ var num const db = wx.cloud.database() db.collection( 'guest' ).doc( 'xxxxxxxxxxxxx' ).update({ data: { num:_inc(1) }, success: function (res) { console.log(res.data) } }) }, |
VM267:1 thirdScriptError
_inc is not defined; [Component] Event Handler Error @ pages/index2/index2#bound guest
ReferenceError: _inc is not defined
官方文档
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/database/query-array-object.html
参考:小程序 数据库 inc的功能? 邓坤力 的回答 - 微信开放社区 https://developers.weixin.qq.com/community/develop/doc/000c0c2fae01c09a4d680afc256400?_at=1568604489308&jumpto=comment&commentid=000620a8d38fa8bd416848c0b5bc