I’m trying to figure out how to upload an excel file with data regarding, say, customers (ie., name, surname, country and phone) and convert those excel rows to mongoDB documents in the collection Customers.
I used xlsx library to transform the excel to json in the client-side and send a json with fetch api and once in the server-side from json to MongoDB. The problem is that when uploading big files (I think problems started at +50k lines) the app just crashes and/or some objets didn’t got saved. And it actually stopped everythink. User can do anythink while it was uploading, which eventually it didn’t either.
Any ideas on how I should approach the issue?
I think the solution must be in node.js streams in some way but idk… Maybe GridFS… I work with node.js in backend (js in frontend) and Express, although a solution without express would be better because at some point I’d like to leave it out.
Thanks!