We have a cap on the total number of wix-data calls a site can make per minute, right?
Suppose I have a database of ~50,000 products. How many calls does the following function consume?
async function checkForProduct(stockCode) {
let result = await wixData.query('products').eq('stockCode', stockCode).limit(1000).find(options);
let allItems = result.items;
while (result.hasNext()) {
result = await result.next();
allItems = allItems.concat(result.items);
}
return allItems;
}
Lets assume that there are only 10 products with the queried stockCode
- The above number of calls should be 2, right? 1 query + 1 hasNext() function
Now how many calls will the below function consume?
async function checkForProduct(stockCode) {
let result = await wixData.query('products').limit(1000).find(options);
let allItems = result.items;
while (result.hasNext()) {
result = await result.next();
allItems = allItems.concat(result.items);
}
return allItems;
}
The answer to the above should be 100, right? because the database has 50,000 products so 50 queries and 50 hasNext() functions.
Another question, without the .eq() will the 50 consecutive queries even be possible? I tried but it never console.logs the 50,000 items array when queried on a backend file.