hey guys
i have some issues with filtering a database according to a max date value.
I want to show the results in a repeater .
Can’t find I need tutorials about it.
Here’s what I have so far:
export function button75_click(beercleaning) {
wixData.aggregate(“beercleaning”)
.max(“date”)
.run()
.then( (results) => {
let maxdate = results.items;
console.log (maxdate)
} )
}
Any ideas?
so i updated my code but i still can’t get it to work and displaying the data in the table. please help me!
export function button75_click(beercleaning) {
wixData.aggregate("beercleaning")
.group('title')
.max("today")
.run()
.then( (results => {
$w('#repeater3').data = results.items
$w('#table2').rows = results.items;
let maxdate = results.items;
console.log (maxdate)
$w("#table2").columns = [
{
“id”: “col1”, // ID of the column for code purposes
// The field key in the collection whose data this column displays
“dataPath”: “title”,
“label”: “title”, // The column header
“width”: 100, // Column width
“visible”: true ,
“type”: “text”, // Data type for the column
// Path for the column if it contains a link
“linkPath”: “link-field-or-property”
},
{
“id”: “col2”,
“dataPath”: “field2”,
“label”: “Field 2”,
“type”: “text”,
“linkPath”: “link-field-or-property”
} //,
// more column objects here if necessary
// …
// …
];
}))
}