gpt4 book ai didi

node.js - Azure Query.where() 与 or

转载 作者:太空宇宙 更新时间:2023-11-04 02:27:12 25 4
gpt4 key购买 nike

我怎样才能做这样的事情:

var userId="patrick";
var finded="bob";
query.where({
userhostid: userId || finded,
});

我只需要添加到 userhostid 等于 userId 或找到的查询项谢谢!

最佳答案

可以使用函数的方式指定条件:

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有关查询中复杂过滤的更多信息。

关于node.js - Azure Query.where() 与 or,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29625696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com