Reputation: 1781
In your expample http://www.breezejs.com/documentation/presenting-many-many how would you write a query to find the hero with this set of powers: ['super strong', 'super fast'] for example ?
Upvotes: 1
Views: 143
Reputation: 514
Try the following:
var listofSuperPowers = ['Super strong', 'Super fast'];
var preds = listofSuperPowers.map(function(sp) {
return breeze.Predicate.create("powerMaps", "any", "power.name", "==", sp);
});
var whereClause = breeze.Predicate.and(preds);
breeze.EntityQuery.from('Heros').where(whereClause)
See http://www.breezejs.com/documentation/query-examples#WhereAnyAll for more breeze examples of querying using composite predicates.
Upvotes: 3