January 2018
Intermediate to advanced
414 pages
10h 29m
English
By default, Spring Data MongoDB will try to connect to a localhost database server in the default MongoDB port 27017. We get that error because our database server was not running. Go to our MongoDB directory, in the bin folder, and run:
mongod -dbpath data
Remember that data is a folder we created previously; if it was not created, create it before we run the MongoDB server. If we run our microservice again in the log lines, we should see something like:
INFO 11440 --- [localhost:27017] org.mongodb.driver.connection : Opened connection [connectionId{localValue:1, serverValue:1}] to localhost:27017
Spring Data Mongo allows us to change the configuration, but first, let's stop our MongoDB server to run it in a different ...
Read now
Unlock full access