it:ad:breeze.js:howto:develop_queries:aggregates

IT:AD:Breeze.JS:HowTo:Develop Queries/Aggregates

Summary

At present (Q1/2014), Breeze can't process Agregate commands.

Breeze does not yet support aggregate queries (count, sum, average, etc.). But we can get the count of a query without retrieving any actual data using the "take(0), inlineCount()" trick.

But there workarounds:

var inlineCount, resultCount, query;
 
query = EntityQuery.from("Products")
    .where("ProductName", "startsWith", "C");
    .take(0).inlineCount();
 
em.executeQuery(query).then(function(data) {
             resultsCount = data.results.length; // 0
             inlineCount = data.inlineCount;     // count of products beginning with 'C'
        });

  • /home/skysigal/public_html/data/pages/it/ad/breeze.js/howto/develop_queries/aggregates.txt
  • Last modified: 2023/11/04 02:18
  • by 127.0.0.1