Hi Rod,
the trick in this case is, that the limit(n) applies to the Wix Data query results and not your custom filtering logic. You queries are actually fetching the whole collection. You filter results later in your code. If you where to use Wix Data filter options, it would try to match and get n matching results for you.
So, what happens:
- You ask for WixData to get all items and set the limit to say 10.
- WixData will fetch first 10 items from the database
- You will filter the matching items from those 10 results and pass those matching the filter on to the table.
As I understand .contains() will not fit you use case as you expect case insensitive match?
Every query returns WixDataQueryResult . It has two helpful methods hasNext() - to check if there are more results and next() to fetch another page of results (following n items). By using them you can traverse the whole collection.
Let me know if you need any further assistance.