简体   繁体   English

水线 ORM (sails.js) “where or” - 效率

[英]Waterline ORM (sails.js) "where or" - effiency

I am using Waterline ORM (sails.js), and the query "where or".我正在使用 Waterline ORM (sails.js) 和查询“where or”。

I have a query with a multiple 'or' in the 'where' section, that checks if any of 2 specific fields are equal to a value in an array我在“where”部分有一个带有多个“或”的查询,用于检查 2 个特定字段中的任何一个是否等于数组中的值

and should return that item,并且应该返回那个项目,

lets say the array is var array = ["Jack", "Kyle","Stan", "Randy"]假设数组是var array = ["Jack", "Kyle","Stan", "Randy"]

and the fields are 'name' and 'nickName', and the query runs -并且字段是'name'和'nickName',查询运行 -

where 
 'name' or 'nickName' equals "Jack"
or
'name' or 'nickName' equals "Kyle"
or
'name' or 'nickName' equals "Stan"
or
'name' or 'nickName' equals "Randy"

Now the query runs extremely slow, and I wish to make it faster.现在查询运行非常慢,我希望让它更快。

is there a way to make the query faster using sails.js?有没有办法使用sails.js 使查询更快? by the waterline ORM?通过水线 ORM?

水线查询语言

More about Waterline query language有关Waterline 查询语言的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM