云函数查询数据库,能不能传递查询语句?
//调用函数
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
}
没有返回结果?
查询语句不能使用参数传递吗?