How do I add excel sheet data to my database which I can then access using MERN?

I have excel data that look like this:

enter image description here

But there’s around 4 more columns and like 500 rows in total. I’m trying to get objects/items in BSON to look like this:

    "_id": 1,
    "SDG": {"number": 13, "name": "Climate action"},
    "Source": "link",
    "Organization": "Kingston"

I’m new to MongoDB and was wondering how I can turn this excel data into the correct format for me to simply add it to my database on MongoDB. Is there a place where I can just drag and drop some data and it’ll turn it into BSON or would I have to manually do it/write code to do it? How would I go about doing that?

Second question, how can I make it so that all someone has to do to update the database is update the original excel sheet and simply just replace a line of code or drag and drop the new file into MongoDB? Is this possible?

Thank you

I recommend processing this via a python script (or similar) first to JSON or to a dictionary data type in Python: from there you can mongoimport the JSON or use the pymongo driver to load it directly into Atlas

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.