Not holding much hope of an answer due to previous experience on here but here goes:
I require many rows to be added to a collection at once, an average of 1500 a time.
If i was using a proper platform i would generate a large object and then insert all rows with one query.
so instead I loop the number of rows i need in a for each and insert with an await wix data insert. This is working up to around 500 or so rows where the system just stops reporting and nothing seems to be happening! checking the collection shows max 650 rows out of 1500!
does anyone please have any Ideas?
I do not have the time to write, yet another, function that checks how many and where the function failed and then re attempt to insert the failed rows. This will be extremely difficult as the data used to generate these rows could potentially be goneā¦
@avillarg using it is not more difficult than looping though the records and inserting them one by one, and it works better.
You can try writing the code, and if it doesnāt work, post your code here and get feedback.
@avillarg No. You put each record in an object, you push each object to an array and then you run bulkInsert on the array.
I may be able to help more if you add details regarding the data you have and its structure and how did you planned to insert it. But as of now your questions are pretty generalā¦
//for (var i = 0; i < 50; i++) for ( var i = 0; i < AllInfo.length; i++)
{
let toInsert =
{
āidClienteā: i,
//āidClienteā: AllInfo[i].IdCliente,
ānombreClienteā: AllInfo[i].NombreCliente,
āentradaNoā: AllInfo[i].EntradaNo,
āmp_espā: AllInfo[i].MP_Esp
};
I am lost at the field āidClienteā, is this a custom field or an autogenerated field? I am sorry if this sounds simple but is this the same as āownerā?
No, itĀ“s got nothing to do with it. The āidClienteā is just a field name (also called ākeyā in Wix Data Manager) in a collection called (generically) myCollection. So if you have a collection where the client ID is called āclientIdā, then you should use āclientIdā in this array of objects before you bulk-insert them to the collection.
I have used several times the wixData . bulkInsert without problems, but now, when I try to import about 3000 registers it doesnāt work, There is a limit to use it?