Objection.js 缺少 FROM 子句
Objection.js Eager is missing FROM clause
我正在为 PostGres 使用反对 js,我试图找到礼品状态为 'Closed' 的付款,但我一直收到错误消息:
missing FROM-clause entry for table
下面是我的查询。
const payments = await GiftPayments.query()
.eager('gift.[detail, status]')
.where('gift.status.name', 'Closed')
.orderBy('gift.id');
我也试过如下所示的 modifyEager,突然状态字段变为空。
const payments = await GiftPayments.query()
.eager('gift.[detail, status]')
.modifyEager('gift', builder =>
{builder.where('name', '=', 'Closed')
})
.orderBy('gift.id');
非常感谢您!
table“礼物”似乎不在 GiftPayments() 中,或者别名为“礼物”以外的东西。
我正在为 PostGres 使用反对 js,我试图找到礼品状态为 'Closed' 的付款,但我一直收到错误消息:
missing FROM-clause entry for table
下面是我的查询。
const payments = await GiftPayments.query()
.eager('gift.[detail, status]')
.where('gift.status.name', 'Closed')
.orderBy('gift.id');
我也试过如下所示的 modifyEager,突然状态字段变为空。
const payments = await GiftPayments.query()
.eager('gift.[detail, status]')
.modifyEager('gift', builder =>
{builder.where('name', '=', 'Closed')
})
.orderBy('gift.id');
非常感谢您!
table“礼物”似乎不在 GiftPayments() 中,或者别名为“礼物”以外的东西。