【发布时间】:2015-11-09 18:02:20
【问题描述】:
我正在尝试在 loopback.io 中执行 not in 查询。但找不到与此相关的任何功能。这是我尝试过的:
Product.find({
where: {
name: {
like: '%' + searchTerm + '%'
},
id: {
neq: [1,2,3]
}
},
limit: 15
}, function(err, searchResults) {...}
而实际上生成的查询是:
'SELECT `id`,`name`,`ref` FROM `Product` WHERE `name` LIKE \'%iPh%\' AND `id`!=1, 2, 3 ORDER BY `id` LIMIT 15' }
我知道我们可以检查一下
field in (n1,n2,...)
使用https://docs.strongloop.com/display/public/LB/Where+filter#Wherefilter-inq。但我无法得到“不在”的情况。
以前有人遇到过这种情况吗?
【问题讨论】:
标签: loopbackjs strongloop