Search...
items
Gets the aggregated values.
Description
Type:
Array<Object>Read Only
Was this helpful?
Get the aggregate values
Copy Code
1let items = results.items;
Run an aggregation and get the aggregate values
Copy Code
1import wixData from 'wix-data';23wixData.aggregate("PopulationData")4 .group("state")5 .max("population")6 .run()7 .then((results) => {8 if (results.items.length > 0) {9 let items = results.items; // see below10 } else {11 // handle case where no matching items found12 }13 });1415/* Given the sample data above, items is:16 * [17 * {"_id": "NY", "populationMax": 8192000},18 * {"_id": "CA", "populationMax": 3796000},19 * {"_id": "FL", "populationMax": 401000}20 * ]21 */