Error creating bean with name 'mongoDatabaseFactory' defined in class path resource. Failed to instantiate [org.springframework.data.mongodb.core.MongoDatabaseFactorySupport]: Factory method 'mongoDatabaseFactory' threw exception with message: Database name must not be empty
I'm not sure what I'm doing wrong here.
error message
application.properties
I can't seem to figure out how to get rid of this message. I have a DB name set in the application.properties. I have MongoDB running and I'm still getting this every time I try to start my server.
Just your fellow learner here, following the same tutorial.
I jumped to the documentation and it seems you just have to add /movie-api-db
at the end of your URI, to get access to the database collection:
spring.data.mongodb.uri=mongodb+srv://<username>:<pwd>@<cluster>.mongodb.net/movie-api-db
Hope, it'll help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With