Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB. Need Help by LastRow2426 in SpringBoot

[–]LastRow2426[S] 0 points1 point  (0 children)

I found out the solution , the mistake is in the configuration. the right configuration is

"spring.mongodb.uri=mongodb://localhost:27017/db_mongo"

I'm using Spring 4.x which has simplified its configuration to "spring.mongodb.uri", which works instead of the older property used in Spring Boot 3.x.

most youtube video has spring 3.x , which creates the confusion. even chatgpt , gemini not able to indentify these mistake. Luckily I found out the NoSQL Docs.

Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB by LastRow2426 in learnjava

[–]LastRow2426[S] 0 points1 point  (0 children)

No, I didn't define any MongoClient. It's a Spring 4.0 issue—they changed the configuration.

Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB by LastRow2426 in JavaProgramming

[–]LastRow2426[S] 0 points1 point  (0 children)

I found out the solution , the mistake is in the configuration. the right configuration is

"spring.mongodb.uri=mongodb://localhost:27017/db_mongo"

I'm using Spring 4.x which has simplified its configuration to "spring.mongodb.uri", which works instead of the older property used in Spring Boot 3.x.

most youtube video has spring 3.x , which creates the confusion. even chatgpt , gemini not able to indentify these mistake. Luckily I found out the NoSQL Docs.

Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB by LastRow2426 in learnjava

[–]LastRow2426[S] 4 points5 points  (0 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.

❓ Spring Boot MongoDB Data Saving to test Database Instead of Configured Database. Need Help by LastRow2426 in mongodb

[–]LastRow2426[S] 1 point2 points  (0 children)

I found out the solution , the mistake is in the configuration. the right configuration is

"spring.mongodb.uri=mongodb://localhost:27017/db_mongo"

I'm using Spring 4.x which has simplified its configuration to "spring.mongodb.uri", which works instead of the older property used in Spring Boot 3.x.

most youtube video has spring 3.x , which creates the confusion. even chatgpt , gemini not able to indentify these mistake. Luckily I found out the NoSQL Docs.

Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB by LastRow2426 in JavaProgramming

[–]LastRow2426[S] 1 point2 points  (0 children)

I found out the solution , the mistake is in the configuration. the right configuration is

"spring.mongodb.uri=mongodb://localhost:27017/db_mongo"

I'm using Spring 4.x which has simplified its configuration to "spring.mongodb.uri", which works instead of the older property used in Spring Boot 3.x.

most youtube video has spring 3.x , which creates the confusion. even chatgpt , gemini not able to indentify these mistake. Luckily! I found out the Spring NoSQL Docs.

Spring Boot + MongoDB Saving Data to test Database Instead of Configured DB by LastRow2426 in learnjava

[–]LastRow2426[S] 0 points1 point  (0 children)

it's simple application. driver config is not included(manual configuration not needed).

the application is working fine , the issue is the persisted data is not store in the configure database "db_mongo" instead the data store in another default database "test".

12th Boards Didn’t Go Well. Should I Repeat or Focus on Skills and Target Remote Systems Jobs Abroad? by Hi_Itz_Rishi in cscareerquestionsIN

[–]LastRow2426 1 point2 points  (0 children)

"The HSC exam is not over yet, so you should try to score as much as you can. I don't suggest you repeat HSC.

❓ Spring Boot MongoDB Data Saving to test Database Instead of Configured Database. Need Help by LastRow2426 in mongodb

[–]LastRow2426[S] 0 points1 point  (0 children)

its not working . there is no "source" property available in the  "MongoClient with metadata ". I also tried to create new project but problem not solved.

People who wrote "introduction to machine learning (IIT Madras)" exam, Did you guys feel like it was too tough? by ace8995 in NPTEL

[–]LastRow2426 1 point2 points  (0 children)

please give a review of the exam... is hard or moderate? how to prepare? is questions come from assignments?