如何在node-orm2中使用逻辑OR运算符从数据库中查找记录?

时间:2014-01-17 07:25:54

标签: node.js node-orm2

我正在处理Node ORM.

我想根据逻辑OR条件找到记录。

1 个答案:

答案 0 :(得分:1)

您必须在Person模型的find方法中传递以下数组。

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