Hi @yisrael-wix
The problem is that my CustomCollection " CustomColl " has one item that appears more than 100 times in the Stores/Orders collection.
Step 1:
Through a backend module .
Add more than 100 different order_id to the same item_id
item_id : Is the item that appears more than 100 times in the Orders collection
order_id : One order can be added to multiple items in my “CustomColl”
“myRefField” : Name of my MULTIPLE-REFERENCE field in my “CustomColl”, that refers to “Stores/Orders” app-collection.
return wixData.insertReference( “CustomColl” , “myRefField” , item_id, order_id )
.then((result) => { return 1 ;});
Step 2:
Through another backend module .
Query “Stores/Orders” to obtain all the orders, where the reference-field ( “CustomColl-1” ) refers to the item_id of step 1. To overcome the 50 items per query limitation, we use manual pagination of 10 items per call.
limit = 10; // constant value, it never changes
skip = 0; // first call is set to 0, then 10, then 20, and so on.
let options = { “suppressAuth” : true };
return wixData.query( “Stores/Orders” )
.hasSome( “CustomColl-1” , item_id )
.descending( “anyField” ) // optional
.limit(limit)
.skip(skip)
.find(options)
.then((results) => {
return results.items;
}). catch ((err) => {console.log( "MY ERR: " +err.message); return err; });
Final Result:
There’s an error in my backendlong that is printed in the step2 catch statement:
“[“MY ERR: {"message":"Too many values (227). Limit: 100.","details":{}}”]”
This code was working perfe ctly when item_id had less than 100 references in the multiple-reference field “myRefField” , which refers to the Stores/Orders app-collection.
Or in other words, it worked fine when the " hasSome " query filtered less than 100 objects in the Stores/Orders app-collection
.hasSome( “CustomColl-1” , item_id )
Or in other words, it fails when item_id appears referenced more than 100 times in the Stores/Orders app-collection.
thank you, let me know if u need something more