Node-ORM2文档说明如下:
1.2.1运算符
要使用简单的=或in运算符,您可以使用稍微不同的语法,如下所示:
model.find({
field : { "operator" : "value" }
});这些运算符是:
Operator Values to use operator
Equals =
Less Than <, “less than”
Less Than or Equal to <=, “less than or equal to”
More than >, “more than”
More than or equal to >=, “more than or equal to”尝试筛选字段大于的查找,如下所示:
Person.find({id: {">": 1000}}, function(err, res) {
});生成的查询如下所示...
... WHERE `id` = `>` = `1000` ...我也尝试使用文本操作符“小于”,它给出了相同的结果。如何使用node-orm2执行WHERE id > 1000查询?
发布于 2017-02-28 00:16:48
我看错了文档,如果有人在寻找相同的答案,请查看:https://github.com/dresende/node-orm2#conditions
https://stackoverflow.com/questions/42420397
复制相似问题