Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute MongoDB script on Spring Boot start

I need to initialize a Mongo DB with some script file like Spring do with JPA and import.sql file.. but how?

Can someone help me?

like image 863
Lucas Avatar asked Oct 24 '25 19:10

Lucas


1 Answers

You could use something similar that's done by mongeez. This is basically a starter for spring-boot that runs scripts before spring-data-mongodb beans are initialized.

like image 83
anand1st Avatar answered Oct 27 '25 11:10

anand1st



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!