@jamie You are welcome. Maybe good to mention that I defined my query using “let query =” because I don’t always filter on the same items so I have some if statements included. In the example below I don’t query on when a store is open if the user selected “all” in the day drop-down.
import wixData from 'wix-data';
function query() {
let query = wixData.query("CollectionName")
query = query.limit(50);
if(daySelected !== 'all') { query = query.hasSome("daysOpen", daySelected); }
//put here additional query criteria
query.find()
.then( (results) => {
$w("#repeater1").data = results.items;
}
}
If you don’t have that kind of needs then you could do it easier like this for your example:
import wixData from 'wix-data';
function query() {
wixData.query("CollectionName")
.eq("published", true)
.ascending("pubdate")
//put here additional query criteria
.find()
.then( (results) => {
$w("#repeater1").data = results.items;
});
}
Here you can find some more info: https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html