Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # IT:AD:Breeze.JS:HowTo:Develop Queries # <callout type="Navigation" class="small"> * [[../|(UP)]] {{indexmenu>.#2|nsort tsort}} </callout> <panel title="Summary"> We use an *EntityManager* instance to process *Queries*, in order to retrieve data from the remote service, in order to make *entities* that are mergeg into the local cache. </panel> ## Process ## The *Query* is built up fluently using terms similar to what you probably already know from [[IT/LINQ/]]. <WRAP tip> The Predicate takes a small getting used to coming. </WRAP> <sxh javascript> function getAllTodos(includeArchived) { var archivedPredicate = new breeze.Predicate("IsArchived", "==", false);; var isDonePredicate = new breeze.Predicate("IsDone", "==", true);; var comboPredicate = archivedPredicate.and(isDonePredicate); var query = breeze.EntityQuery .from("Todos") .where("IsArchived", "==", false); .where("IsArchived", op.NotEquals, true) //Or use predicate: .where(archivedPredicate) //Or use combinined predicates: .where(comboPredicate) .skip(3*20) .take(20) .orderBy("CreatedAt") .inlineCount() //cute...returns a count of the items on the server. ; </sxh> <WRAP important> Notice how you built up the `where` clause before hand, as composite predicates using `and` and `or`. </WRAP> You then send it off and process the async results: <sxh javascript> manager.executeQuery(query) .then(function(data) { products = data.results; // a page of products beginning with 'C' resultsCount = products.length; // 0 <= resultsCount < pageSize inlineCount = data.inlineCount; // count of products beginning with 'C' }); </sxh> ### More See: http://www.breezejs.com/documentation/query-examples ## Resources ## * http://www.breezejs.com/documentation/querying-depth * http://www.breezejs.com/documentation/query-examples /home/skysigal/public_html/data/pages/it/ad/breeze.js/howto/develop_queries/home.txt Last modified: 2023/11/04 02:18by 127.0.0.1