node-orm2

How do I query multiple rows in node-orm2?


From the manual I understand the following instruction...

Person.find({ name: "Jack" }, function (err, people) {
// finds people with name='Jack'
});

I would like to find two people, "Jack" and "Jill". This is obviously incorrect, but something like...

Person.find({ name: "Jack" AND name: "Jill" }, function (err, people) {
// finds all people with name='Jack' and name ='Jill' 
});

Solution

  • Person.find({or:[{name: 'Jack'}, {name: 'Jill'}]}, function(err, res) {
    
    });