Breeze 쿼리에 여러 조건자를 추가 할 수 있습니다. 이런 식으로 너무 많은 추가 조심, 그러나 이것은 우리가 이것을 할 수있는 방법의 완벽한 예입니다 -
function getAllTodos(todoIds) {
var Predicate = breeze.Predicate;
var query = breeze.EntityQuery
.from("Todos")
.orderBy("CreatedAt");
var compoundPredicates;
if (todoIds) {
var criteriaPredicate;
$.each(todoIds(), function(index, item) {
criteriaPredicate = (index === 0)
? Predicate.create('todoId', '!=', item)
: criteriaPredicate.or('todoId', '!=', item);
if (Predicate.isPredicate(criteriaPredicate)) {
compoundPredicates = compoundPredicates.and(criteriaPredicate);
}
}
}
}
이 화합물이 함께 술어와 ID가없는 경우에는 모든 할 일이야 얻을에 (또는 유사한 무언가)을 수행 할 수 있습니다 배열에있는 값과 같습니다.