Database Query Results Limited to 50

I have created a database table with four different kinds of filter buttons for the end user. It works great, but I have noticed that if it should return more than 50 results, they aren’t there. It stops at 50.

If you want to see what I mean, here is the page:

password: BigD4BigOdor
Type “gallon” into the size filter as an example. It should return more than 50 results, continuing with more 300000 numbers and then some 500000 numbers, but it stops at 50.

Here is my code:

import wixData from 'wix-data';
// ...
$w.onReady(function() {
// ...
$w("#dataset1").setSort( wixData.sort()
  .ascending("product")
)
.then( () => {
  console.log("Dataset is now sorted");
} )
.catch( (err) => {
  console.log(err);
} );
});

export function button1_onClick(event) {
     let searchValue = $w('#input1').value;
     wixData.query('Products')
        .contains('product', searchValue)
        .ascending("product")
        .find()
        .then(res => 
        {
            let foundItems = res.items;
            $w('#table1').rows = res.items;
            
        });
}

export function button2_onClick(event) {
     let searchValue = $w('#input2').value;
     wixData.query('Products')
        .contains('title', searchValue)
        .ascending("product")
        .find()
        .then(res => 
        {
            let foundItems = res.items;
            $w('#table1').rows = res.items;
            
        });
}

export function button3_onClick(event) {
     let searchValue = $w('#input3').value;
     wixData.query('Products')
        .contains('fragrance', searchValue)
        .ascending("product")
        .find()
        .then(res => 
        {
            let foundItems = res.items;
            $w('#table1').rows = res.items;
            
        });
}

export function button4_onClick(event) {
     let searchValue = $w('#input4').value;
     wixData.query('Products')
        .contains('size', searchValue)
        .ascending("product")
        .find()
        .then(res => 
        {
            let foundItems = res.items;
            $w('#table1').rows = res.items;
            
        });
}

Any help would be greatly appreciated!
Sarah

Hi Sarah!

The WixDataQuery is limited, and to 50 by default.
But, you can look into the API and learn how to expend your limit to up to 1000!

Hope it helps.
Best of luck!

Doron. :slight_smile:

Thank you! I added this line before .find() on each button and it worked perfectly!

        .limit(1000)