为什么同样的表达式,云函数只能获取一大组数据,而不用云函数就能获取指定的数据?
例如:在云函数中:
const db=cloud.database()
const _ = db.command
// 云函数入口函数
exports.main = async (event, context) => {
return await db.collection('xiangmu').where({
openid:event.openid,
bhao:event.bha
}).get()
在普通前端JS中代码
db.collection('xiangmu').where({
openid:options.openid,
bhao:options.bhao
}).get().then(res=>{
console.log(res)
})
前端能够获取数据库里面相同条件的一个数据,而云函数,则是获取了同个openid下的所有数据,而bhao没有起到作用,请问是怎么回事,
希望高手解答,谢谢
网友回复
Mr.Zhao:
去高级操作里面执行下看看