Issue
In NestJS / Typeform I want to make a query that sues to conditions as an AND
condition.
I tried something like this
async getByUniqueConstraints(user: User){
const {email, phoneNumber} = user
const foundUser = await this.userRepository.findOne({where: [email, phoneNumber], });
}
The problem with this is that it uses an OR
condition. Is there a way to use this with an AND
operator instead without using a querybuilder or any more advanced concepts?
Solution
where
with fields in curly braces uses AND operator. You can see it in docs here: https://github.com/typeorm/typeorm/blob/master/docs/find-options.md
Answered By - ruciu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.