Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OR clause in where condition not working #208

Open
sgda021992 opened this issue Jun 8, 2019 · 0 comments
Open

OR clause in where condition not working #208

sgda021992 opened this issue Jun 8, 2019 · 0 comments

Comments

@sgda021992
Copy link

Hi,

I have a query like (Select * from users where user.name='asd' OR user.lastname = 'asdaff')

I have written my code like this:-

Users.findOne(
{
where: {
or: [
{ name: req.params.name },
{ lastname: req.params.lastname }
]
}
}, function (err, user) {
if(user) {
done(user, null);
} else {
done(null, err);
}
});

but it's not working throwing me error null.
Can u tell me how can i achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant