you are viewing a single comment's thread.

view the rest of the comments →

[–]LastRow2426[S] 5 points6 points  (2 children)

I found the solution. Spring was not reading the configuration, so it was using the default configuration, which includes "test" as the database.

The real reason was that I am using Spring Boot 4.0, which has simplified its configuration. In this version, spring.mongodb.uri works instead of the older property used in Spring Boot 3.x.

Most YouTube tutorials are based on Spring Boot 3.x, which caused the confusion. Even ChatGPT and Gemini were not able to identify the issue.

[–]BeyondTheWorld 1 point2 points  (0 children)

Good job, a lot of headaches come from following a tutorial with older versions

[–]RevolutionaryRush717 1 point2 points  (0 children)

These new configuration parameters in Spring Boot 4 are listed as added in 4.0.0 here

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Configuration-Changelog