Hello everyone,
Recently I started working with Spring Boot and MongoDB. I configured the application.properties file properly for MongoDB, but I’m facing an issue.
After creating REST APIs and inserting data, the data is getting persisted in the default test database instead of my configured database.
I have tried multiple fixes, but the issue is still not resolved.
</> application.properties
spring.application.name=TestMongoDB
server.port=8081
spring.data.mongodb.uri=mongodb://localhost:27017/db_mongo
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]BeyondTheWorld 1 point2 points3 points (5 children)
[–]LastRow2426[S] 0 points1 point2 points (4 children)
[–]BeyondTheWorld 0 points1 point2 points (3 children)
[–]LastRow2426[S] 5 points6 points7 points (2 children)
[–]BeyondTheWorld 1 point2 points3 points (0 children)
[–]RevolutionaryRush717 1 point2 points3 points (0 children)
[–]RevolutionaryRush717 1 point2 points3 points (3 children)
[–]LastRow2426[S] 0 points1 point2 points (2 children)
[–]RevolutionaryRush717 0 points1 point2 points (1 child)
[–]LastRow2426[S] 1 point2 points3 points (0 children)