收藏
回答

云函数查询数据库,能不能传递查询语句?

//调用函数
wx.cloud.callFunction({
name: 'Share',
data: {
type: 'selectRecord',
query:"db.collection('s_log').where({log:null}).get()"
}
})


//云函数
const cloud = require('wx-server-sdk')
const db = cloud.database()
exports.main = async (event, context) => {
return await event.query
}


没有返回结果?

查询语句不能使用参数传递吗?

回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2021-09-30

    你传过去的是字符串,字符串怎么运行?

    2021-09-30
    有用 1
    回复 1
    • FreeFlight
      FreeFlight
      2021-10-01
      谢谢!
      2021-10-01
      回复
登录 后发表内容