caminte icon indicating copy to clipboard operation
caminte copied to clipboard

OR clause in where condition not working

Open sgda021992 opened this issue 5 years ago • 0 comments

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.

sgda021992 avatar Jun 08 '19 22:06 sgda021992