Querying more than 1000 enteries. To push data in a repeater

Hello guys. Trying to query database with more than 1000 entries to push data into a repeater.

Seeing other posts in the forum, (thanks for this), I’ve managed to build the data query, but it is not pushing into the repeater.

Can anyone please advise what I am doing wrong?

TIA!

Code below:


import wixData from 'wix-data';

$w.onReady(function () {

    $w("#dynamicDataset").onReady( () => {

            
            $w('#OUcountryname').text = $w("#dynamicDataset").getCurrentItem().countryName;     
            console.log($w("#dynamicDataset").getCurrentItem().countryName);    
            $w('#OUregion').text = $w("#dynamicDataset").getCurrentItem().region;

         

            $w("#repeater1").onItemReady( ($item, itemData, index) => {

            console.log(index);
            if(index < 9){
                $item("#OuOpsUpdatetext").text = "Ops update:00" + String(index+1);
            }
            else if (index >= 9){
                $item("#OuOpsUpdatetext").text = "Ops update:0" + String(index+1);
            }
            else if (index > 100){
                $item("#OuOpsUpdatetext").text = "Ops update:" + String(index+1);
            }
            
            $item("#textfromOUDB").text = itemData.opsUpdate;
        });

        

            wixData.query("OpsUpdate")
            .eq("countryName",  $w("#dynamicDataset").getCurrentItem().countryName)
                .limit(1000)
                .find()
                .then((results) => {
                    if(results.items.length > 0) {
                    
                let allItems = results.items;
                console.log(allItems);
                while (results.hasNext()) {
                    let results1 =  results.next();
                    console.log(results1);
                    allItems = allItems.concat(results1);
                }
                return allItems;

                    } else {
                    // handle case where no matching items found
                    }
                })
                .catch((error) => {
                    let errorMsg = error.message;
                    let code = error.code;
                });
                    
    });
 

});

Your repeater do not work, because nowhere inside of your code you feed the repeater with data.

Maybe you get results from your query-action, but you do not FEED YOUR REPEATER WITH DATA.

You generated the → onItemReady() function, but where is…---->

$w("#repeater1").data = "yourWishedRepeaterDathere"; 

???

Your repeater do not know which DATA to show!

And if you think it will somehow work magically, because you connected another DATASET to your REPEATER → it won’t!!!

And at least never mix Wix-Data and Dataset actions → this ends in most cases in troubles and gives you a lot of headaches.

Either go the one OR the other way.

Even good coders, have difficulties, if it comes to work in MIXED-MODE.

Another suggestion:

why you do that? —>

$w('#OUcountryname').text =$w("#dynamicDataset").getCurrentItem().countryName;
console.log($w("#dynamicDataset").getCurrentItem().countryName);

Why not first get ALL THE INFORMATION about the wished ITEM, like…

let myCurrentItemData = $w("#dynamicDataset").getCurrentItem();

…and then get out of your ITEM what ever you want…

let countryName = myCurrentItemData.countryName;
let region = myCurrentItemData.region;