HBuilder X 3.99
前端代码:
var res = await DB.collection('test')
.where("code == '123'")
.update({ test: test})
后端代码:
beforeUpdate: async function({
collection,
operation,
docId,
where,
updateData,
clientInfo,
triggerContext
} = {}) {
const dbJQL = uniCloud.databaseForJQL({
clientInfo: clientInfo,
skipTrigger: true
})
console.log(where)
var res = await dbJQL.collection('test').where(where).get() // 这里查不到数据
}
在后端数据库触发器中获得的 where 是,查不到数据:
{"code":{"operator":"eq","operands":["123"],"fieldName":{}}}
使用以下条件就可以查到:
{ "code": "123" }
4***@qq.com (作者)
有不升级的办法么,老项目了
2025-03-15 19:14
DCloud_uniCloud_CRL
回复 4***@qq.com: 现在hx什么版本?
2025-03-17 11:33