Wix query only works half of the time, with same params (query error)

Hi, my site has dropdown so that the user can select which params they want to search for in the database. The problem is when the user does a search, the console says that there is an uncught error. This is wrong… because EVERYTHING is surrounded by a try catch with a print of which error. Here is a screenshot of what i mean:

The console log is what the user searches for, but the query is the exact same function. Basically, i can keep pressing the export button(from database) untill it works. The only error i recive is this:

But it leads me nowhere… only shows wix’s own code. This is the query

wixData.query( “LeadsBeta” ).not(wixData.query( “LeadsBeta” ).hasSome( “orgNr” , arrayReturned))
.contains( “searchCounty” , $w( “#dropdown6” ).value)
.contains( “searchBranch” , $w( “#dropdown4” ).value)
.between( “revenue” , inputRevMin, inputRevMax)
.between( “regDate” , inputYearMin, inputYearMax)
.ne( “orgNr” , localOrg)
.ne( “tel” , cmpTelSort)
.ne( “kontaktperson” , cmpContactPersonSort)
.ne( “besoksadress” , cmpVisitLocationSort)
.ne( “revenue” , cmpRevenueSort)
.ne( “regDate” , cmpRegDateSort)
.ne( “website” , cmpWebsiteSort)
.ne( “email” , cmpEmailSort)
.ne( “resefin” , cmpResultsSort)
.ne( “profit” , cmpProfitsSort)
.ne( “asset” , cmpAssetsSort)
.limit(leadsInt)
.find()
.then ((results)=> {rest of the code here})

the error occurs inside the query, not after the .then function. To mention again, the query DOES work sometimes, but sometimes it doesnt, i can search for the same thing many times untill it works, and not give me an error. Please can someone help me. Im not a beginner at js but im not a master either.

Please post the URL of your site.

Hi the url is https://www . superleads . se / mitt-konto

I tried making a whole new database, i thought it had something to do with utf-8 but the issue still remains. I think it might have something to do with the request taking too long?

I solved it, if anyone else is having the same issue, i will explain what the sollution is.

Wix database can be basically as big as you want, atleast it is said to manage that. however my database was over 400 000 rows, because it was too big it kept throwing me an unnamed error. If your recive this unnamed error it is probably because the database is too big. Split it up into more smaller ones.

I took a look at the mitt-konto page on your site, and I very much doubt that the size of the database collection is an issue. You are also using Firestore and the resulting code is complicated and complex. It is quite likely that your interfacing with this external service is “interfering” (if you will) with the expected database results.

Wix is unable to provide support or debugging of code based on external libraries. However, I believe that the initializations of the firebase code should be inside of the page’s onReady() to ensure that the code is executed properly and at the appropriate time. Other issues such as missing or improper handling of Promises from the Firebase API might also be causing issues.

Wix Data is capable of extremely large collections that do not impose practical limits on queries and database actions. There are many Wix sites that have database collections much, much larger than the 400,000 records you have mentioned.

I would suggest that you create a test page that only uses the Wix database collection without all of the complications and complexities of the extra code and API calls to Firebase. You will find that the Wix Data system is robust and efficient, and should not impose any limits as you seem to be encountering with your inclusion of the external Firebase interface.