簡體   English   中英

如何在node-orm2字段上使用查找運算符?

[英]How do I use find operators on node-orm2 fields?

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查詢?

我正在查看錯誤的文檔,如果有人在尋找相同的答案,請查看: https : //github.com/dresende/node-orm2#conditions

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM