You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,
how to get total sum of particular column , some thing like aggregation functionality , does sembast function this types of function.
The text was updated successfully, but these errors were encountered:
VarmaTech
changed the title
How to Aggregation function of Column like sum , avg
How to Apply aggregation function of column like sum , avg
Aug 12, 2020
Unfortunately no. However, data being in memory getting all the records and performing operation on the results does not cost much. example below to compute the sum and average of the fied age:
var store = intMapStoreFactory.store();
await store.addAll(db, [
{'name':'cat', 'age':13},
{'name':'dog', 'age':12},
{'name':'rabbit', 'age':8}
]);
var ages = (await store.find(db)).map((snapshot) => snapshot['age']);
// Compute sumvar sum = ages.reduce((value, element) => value + element);
// Compute averagevar average = sum / ages.length;
Hi ,
how to get total sum of particular column , some thing like aggregation functionality , does sembast function this types of function.
The text was updated successfully, but these errors were encountered: