我想在我的 repo 中找到结果,其中 firstname 类似于 'john' OR lastname 类似于 'doe' 但 findOptions where 子句将其视为 AND。
我试过的:
let results = await userRepo.find({
where : {
firstname : Like('%John%'),
lastname : Like('%Doe%'),
}
});
Run Code Online (Sandbox Code Playgroud)
我对此的期望:
let results = await userRepo.find({
where : {
firstname : Like('%John%'),
lastname : Or(Like('%Doe%')),
}
});
Run Code Online (Sandbox Code Playgroud)
关于如何在 where 对象中使用OR 的任何帮助?
typeorm ×1