Im using the Queryreferenced to overcome the limitation of include giving only 50 references at most.
Changing the three variables given the Queryreferenced for security.
But i seem to still be limited to recieving only 50 references of highschools (exist 130 ish).
This is troublesome since i use it in a search to limit results to not at all or only be highschools but all references not included in these 50 references saved in “HighschoolsOnly” will still be shown breaking my search field.
Limit does not function in collaboration with queryreference only Query alone.
My apologies for not clarifying ive already tested this.
wixData.queryReferenced(“Collection”, “MyReferenceID”, “MyTable”) .limit(1000) make an error instead of allowing 1000 results.
@clsnlsen Yes I do. The API for reference fields interactions works really bad. I managed to worked around, by fitlering a dataset. In my case, I wanted to obtain all the objects where the reference field exists. So query of empty/notempty/etc didnt work. There are only like 10 type of IDs for the reference field, and therefore are filter the dataset for any of those 10 IDs, and thats how I got all the items I wanted, fitlered by a reference field, and overcomming the 50 query limitation.
Please WIX, improve your reference fields interactions.
@yisrael-wix is there any way to query more than 50 referenced fields?
Doing it the other way around, with am api “query” and “.hasSome”, can be up to 100, but it still ignores the “.limit(x)” if there are more than 100 items. Is there any upadate on this from WiX side?
@yisrael-wix
I’ll answer here to keep up with the main thread. When querying with a referenced field with mroe than 100 values fails
This option gives an error that ot doesnt recognise “.limit(x)” function return wixData.queryReferenced( “MyColleciton” , someId, “MyReferencedField” , options)
.limit(limit)
.skip(skip)
.then((results) => {
The following works upto 100 referenced items regardless of the value inside lmit. More than 100 items it fails
let options = { “suppressAuth” : true }; return wixData.query( “Stores/Orders” )
.hasSome( “MyCollectionReferencedField” , someValue)
.descending( “number” )
.limit(10)
.skip(10)
.find(options)
.then((results) => {
If I take out the referenced field it works ok
let options = { “suppressAuth” : true }; return wixData.query( “Stores/Orders” )
.descending( “number” )
.limit(10)
.skip(10)
.find(options)
.then((results) => {
From the apilimit():
" the maximum limit for the Wix Stores/Product collection is 100. "
But I want to do a manual pagination of referenced fields of 10 items on each batch, if the total amount of referenced fields is above 100 it fails, regardless of my limit set to 10.
Is there any advanced on this? If not, I have to change my DB architecture, which impacts my functionalities, and I prefer to do that now, rather than later
Yest, but I am doing a manual pagination of 10 items on each bacth. So I am querying 10 Stores/Orders objects, filtered by a referenced field. If the referenced field ID appears more than 100 times in the Stores/Orders collection it fails, regardless of my limit set to 10.
Did I explain myself? The behaviour seems contradictory.
@yisrael-wix Yes, when the referenced field appears less than 100 times works perfect, i can do the manual pagination ok. But now the reference field appears 105 times, and I cannto do it.
This is the error I get on backend log:
{"message":"Too many values (105). Limit: 100.","details":{}}