小程序
小游戏
企业微信
微信支付
扫描小程序码分享
filterXXX:function () { this.data.collection('xxx').where({class:'a',title:'b'}).get({ success:res=>{ console.log(res.data) } }) } 以上代码报错,console错误提示如下 TypeError: this.data.collection is not a function
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
原生JS数组是不支持collection方法的
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
应该是这样才对。
filterXXX:function () { const db = wx.cloud.database() db.collection('xxx').where({class:'a',title:'b'}).get({ success:res=>{ console.log(res.data) } }) }
参考一下数据库增删查改 (SDK)初始化的文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/database/init.html 。
请各位前辈指点指点🙏
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
原生JS数组是不支持collection方法的
应该是这样才对。
filterXXX:function () { const db = wx.cloud.database() db.collection('xxx').where({class:'a',title:'b'}).get({ success:res=>{ console.log(res.data) } }) }
参考一下数据库增删查改 (SDK)初始化的文档:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/database/init.html 。
请各位前辈指点指点🙏