有人能提供如何在loopback 3中重写patchAttributes方法的语法吗?我正在使用以下语法,它不起作用
BUILDING.on('attached', () => {
BUILDING.patchAttributes = (id, data, { }, next) => {
app.models.AC_BUILDING.patchAttributes(data,(err, res) => {
next(err, res)
})
}
}发布于 2020-10-14 23:20:35
PersistedModel对象或其实例上不存在patchAttributes方法。您可以在http://apidocs.loopback.io/loopback/上查看验证应用编程接口文档。我认为您可能与updateAttribute或updateAttributes方法混淆了。如果您想要更新持久化模型上的某些属性,则可以使用updateAttribute或updateAttributes。
https://stackoverflow.com/questions/64221647
复制相似问题