小程序云开发无法获取到数据库内数据
代码如下
JS
const app = getApp()
const db = wx.cloud.database({
env: ‘nxdcs-service’
})
Page({
data: {
name: “”,
TGF1: “”,
TGF2: “”,
TSJ1: “”,
TSJ2: “”,
FGF1: “”,
FGF2: “”,
FSJ1: “”,
FSJ2: “”,
FCO2: “”,
searchContent: “”,
todoList: []
},
//监听input输入
watchName: function (e) {
var that = this
that.setData({
name: e.detail.value
});
},
queryTodoList() {
wx.showLoading({
title: ‘正在查询…’
})
//测试一下能不能用
const db = wx.cloud.database()
db.collection(‘mhq’).where({
name: db.RegExp({
regexp: this.data.name,
options: ‘i’,
})
}).get({
success: res => {
this.setData({
todoListFetched: true,
todoL