我正在研究Node ORM.
我想根据逻辑或条件查找记录。
最佳答案
您必须在 Person 模型的 find 方法中传递以下数组。
Person.find({or:[{col1: 1}, {col2: 2}]}, function(err, res) { // res is Person where col1 == 1 or col2 == 2 });
关于node.js - 如何在node-orm2中使用逻辑OR运算符从数据库中查找记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21180144/