2020-06-01T13:14:32.776Z TypeError: {openid} is not a function
at Array.find (native)
at db.collection.where.get.then.res (/var/user/index.js:23:82)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
我创建的记录,当别人查询时报上述错误,数据库权限自定义为read:true,update:true
你自己调用没问题吗?另外提供你的云函数代码更容易确定问题所在。
userEndDate: _.gt(currentDate)
}).get().then(res => {
console.log(res.data);
for (let i = 0, len = res.data.length; i < len; ++i) {
info.push({
id: res.data[i]._id,
theme: res.data[i].theme,
start: new String(res.data[i].userStartDate).substr(0, 16),
bookingOrEnter: res.data[i].openid == wxContext.OPENID || res.data[i].personList.find(wxContext.OPENID) != undefined? "进入": "预约"
})
}
}).catch(console.error)
bookingOrEnter: res.data[i].openid == wxContext.OPENID || res.data[i].personList.find(wxContext.OPENID) != undefined? "进入": "预约"
改为:
bookingOrEnter: (res.data[i].openid == wxContext.OPENID || res.data[i].personList.find(wxContext.OPENID) != undefined)? "进入": "预约"
目测楼主是java代码写得比较多
云函数显示调用成功,但报上述的错误