'Is there a way to save data from csv to mongodb?

I have a CSV file, and I'm trying to import the CSV file in the MongoDB database. Unfortunately, the experience is not working as I wish it would. The content of the CSV file is not relevant, since when I use MongoDB Compass to import it manually, there is no issue and it's appearing as I want. Thus, I'm trying to save it from local folder to the MongoDB using Java and Spring Boot if possible, but I can't find any good advice or explaination about how to do so.

I'm using Spring Boot 2.6.3 and Java11.

Thanks a lot.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source