I have a JSON file that contains more than six thousand items. How can I use bulkinsert() to add them to the database??
import wixData from 'wix-data';
let items_to_update = [{},{},{},{},{},{},........., upto 6563]; // JSON Data
wixData.bulkInsert("Try", items_to_update )
.then(response => {
console.log(response)
})
.catch(err = > {
console.log(err)
});
Currently, wixData API doesn’t allow more than 1000 items to update or insert through bulkInsert() or bulkUpdate(). Hence, I was thinking if there any way using LOOPS and PROMISES, we can update more than 1000 items.
I thought of that but I get confused house to use promises since I have to bulkinsert after one batch is already inserted. The combination of loop and promises confused me.