【发布时间】:2021-08-11 03:07:00
【问题描述】:
谁能帮我解决这个问题?
尝试使用 typeorm 在 postgres 中搜索时出错。我正在尝试传递 Raw where,但出现以下错误:
{
"error": "column \"mm\" does not exist"
}
这是我使用 Raw 的代码:
const appointments = await this.ormRepository.find({
where: {
date: Raw(
dateFieldName =>
`to_char(${dateFieldName}, MM-YYYY) = '${parsedMonth}-${year}'`,
),
},
});
非常感谢!
【问题讨论】:
标签: node.js typescript postgresql typeorm