Question

How can I query in breeze a contains query of list if integers?

kind of this?

elemnts.where(p => listofids.contains(p.id));
Was it helpful?

Solution

For now you need to use 'or' clauses

  var whereClause = breeze.Predicate.create("id", "==", 3)
         .or("id", "==", 5)
         .or("id", "==", 6);
  var query = breeze.EntityQuery.from("elemnts").where(whereClause);

or ( with your list of ids):

  var preds = listOfIds.map(function(id) {
     return breeze.Predicate.create("id", "==", id);
  })
  var whereClause = Predicate.or(preds);
  var query = breeze.EntityQuery.from("elemnts").where(whereClause);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top