【发布时间】:2015-12-18 03:12:33
【问题描述】:
我怎么能做这样的事情:
var userId="patrick";
var finded="bob";
query.where({
userhostid: userId || finded,
});
我只需要添加到 userhostid quals to userId 或找到的查询项目 谢谢!
【问题讨论】:
标签: node.js azure azure-mobile-services
我怎么能做这样的事情:
var userId="patrick";
var finded="bob";
query.where({
userhostid: userId || finded,
});
我只需要添加到 userhostid quals to userId 或找到的查询项目 谢谢!
【问题讨论】:
标签: node.js azure azure-mobile-services
可以使用指定条件的函数方式:
var userId="patrick";
var finded="bob";
query.where(function(value1, value2) {
return this.userhostid == value1 || this.userhostid == value2;
}, userId, finded);
http://blogs.msdn.com/b/carlosfigueira/archive/2012/09/21/playing-with-the-query-object-in-read-operations-on-azure-mobile-services.aspx 的博文包含有关查询中复杂过滤的更多信息。
【讨论】: