我正在尝试建立一个有效Id的列表,并将它们作为.Any谓词附加到查询中。我升级到最新的Breeze以访问filterQueryOp.Any并编写了以下代码。可悲的是,它错了。
var ids = [];
listData.forEach(function (item) {
ids.push(item.TicketId)
});
combined = combined.and(new breeze.Predicate('ItemId', breeze.FilterQueryOp.Any, ids));
var result = breeze.EntityQuery.from('Tickets').using(itemManager)
.where(combined)
.execute()
.fail(util.queryFailed);
接下来是由Breeze
构建的查询"(((StatusKey eq 65540) and (ParentKey eq 123743) and (Created ge datetime'2013-04-30T04:00:00.000Z') and (Created lt datetime'2015-05-01T04:00:00.000Z')) and (Open eq true)) and (ItemId/any(x6: 180170,180172,180173,180197,180198,180199,180200,180201,180204,180205,180206))"
我们最终可以看到它已经做了一些合理的.Any,到目前为止一直很好。
然后这个结果:
"')' or ',' expected at position 200 in '(((StatusKey eq 65540) and (ParentKey eq 123743) and (Created ge datetime'2013-04-30T04:00:00.000Z') and (Created lt datetime'2015-05-01T04:00:00.000Z')) and (Open eq true)) and (ItemId/any(x6: 180170,180172,180173,180197,180198,180199,180200,180201,180204,180205,180206))'."