Parag Kuhikar
Parag Kuhikar

Reputation: 485

How to use logical OR operator in node-orm2 for finding records from database?

I am working on the Node ORM.

I want to find the records based on logical OR condition.

Upvotes: 2

Views: 812

Answers (1)

Parag Kuhikar
Parag Kuhikar

Reputation: 485

You have to pass following array in the find method of the Person model.

Person.find({or:[{col1: 1}, {col2: 2}]}, function(err, res) {
  // res is Person where col1 == 1 or col2 == 2
});

Upvotes: 2

Related Questions