是否可以在breeze.js中使用某种嵌套谓词?
我想要(a) and(b or c or d))
我只能在没有逻辑括号的情况下链接谓词:
predicates = predicates.and(a);
predicates = predicates.or(b);
predicates = predicates.or(c);
predicates = predicates.or(d);
// predicates not nested: a and b or c or d
答案 0 :(得分:2)
您应该撰写谓词:
var leftSide = predicates.or(b).or(c).or(d);
var composedPredicate = leftSide.and(a);
它会给你:
(b or c or d) and a
编辑:
刚刚找到一个非常有用的帖子:
How do I write a breeze Predicate equivalent to the following SQL