caminte
caminte copied to clipboard
OR clause in where condition not working
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.