query limit error

hello, i have a query that uses limit(900).
today i noticed that if I’m using a number larger than limit(99) the query just fails.
nothing special in the database… please help

this is the code:

function queryToday(truckPlate, CurrnumHanafot, avgTimePerHanafaC, avgTimePerHanafa, LastWeekNumHanafot) {
let QueryChosenDay = wixData.query("ramzor").contains("createdAfterInsert", chosenDay); //query3
console.log("in queryToday")
console.log("chosenDay = " + chosenDay)
console.log("truckPlate = " + truckPlate)
wixData.query("ramzor").contains("licensePlate", truckPlate)
.and(QueryChosenDay)
.limit(900)
.find()
.then((CurrTrucks) => {
console.log("currTrucks queryToday  = " + CurrTrucks.items)
CurrnumHanafot = CurrTrucks.items.length;
console.log("truck queryToday" + truckPlate + " CurrnumHanafotItems " + CurrnumHanafot);
if (CurrnumHanafot > 0) {
calcCurrentStats(CurrTrucks.items);
}
setTimeout(() => { calcStats(truckPlate, CurrnumHanafot, Number(avgTimePerHanafaC), avgTimePerHanafa, LastWeekNumHanafot); }, 50);
})
.catch((err) => {
console.log("Error calcDataView / resultsCurr")
});
}

i think there’s something to do with that i have some reference fields in the queried database… maybe?

hi, more data, i tried many ways to solve this issue. another thing i noticed is that a dataset connected to the same database (ramzor), is loading very quickly, same as the connected repeater and data.

the problem starts when i use getItems as in attached code:

let totalItems = $w("#dataset3").getTotalCount();
console.log("totalItems = " + totalItems)
$w("#dataset3").getItems(0, totalItems)
.then((result) => {
    console.log("in getitmes")
    let items = result.items
})

if i set the num of values to totalItems which in some cases is few hundreds to large number including totalItems, i get an error, sometimes bad gateway, sometimes promise… please help…