javascript - 类型 'number' 与类型 'FindOneOptions' 没有共同的属性
在使用 TypeORM 创建 findOne 请求时,我遇到了这个错误,帮帮我!
答案#1
根据 TypeORM 文档,您需要像这样调用 findOne(假设 clientId 也是 Client 表中列的名称)。
const client = await Client.findOne({
where: {
clientId: clientId
}
});
错误信息告诉你它期望的是 FindOneOptions<Client>,但你给的是 number。
