Seems there is a 1000 limit for a query and my database is 1972 lines long, what do I do?

Hi,
I think all my other problems might be related to this one. I didn’t realise I wasn’t getting all the results in my query.
I need the uniqueTitles as labels in a dropdown list. so i can filter a referenced collection otherwise my repeater is huge and slows to a halt during testing if i add more than 50 repeating items.
CODE EXAMPLE HERE…

$w.onReady(function () {

//Populate Common Name dropdown
wixData.query(“Collection_Ref”)
.ascending(“CommonName”)
.limit(1000)
.find()
.then(results => {
const uniqueTitles = getUniqueTitles(results.items);
$w(“#dropdownCommonName”).options = buildOptions(uniqueTitles);
});

function getUniqueTitles(items) {
// Use the map method to create the titlesOnly object containing all the titles from the query res
const titlesOnly = items.map(item => item.CommonName);
// Return an array with a list of unique titles
return […new Set(titlesOnly)];
}

function buildOptions(uniqueList) {
return uniqueList.map(curr => {
// Use the map method to build the options list in the format {label:uniqueTitle, value:uniqueTitle}
return { label: curr, value: curr };
});

}
});

Hi,
I’m not sure that I fully understand what is the scenario. Do you wish to display the titles of all your records in a dropdown list? Can you please elaborate how does your collections look like? Do you have a collection and a referenced collection and which results do you wish to display?

Tal.

I am trying new tack now. I want to create a manual table of contents on the page and the user selects a tab and only searches part of the database. I think this is the way it was intended to work as their is a 1000+ limit. Other suggest this is done by splitting database into chunks of rows by one of the column groups. so say i have 24 groups the database can be split into, do i need to duplicate, sort duplicate and sort 24 times, then call databases “main database” + “n…n-1”, n being 24 groups that it can be split into.