Du behöver bara definiera respektive mongobd-egenskaper i application.properties
fil eller om du vill yml-syntax, definiera rekvisita i application.yml
. Under src/main/resources
, application.properties
borde redan finnas där.
application.properties
:
spring.data.mongodb.host=<hostname>
spring.data.mongodb.port=27017
spring.data.mongodb.database=<dbname>
spring.data.mongodb.username=<usernamr>
spring.data.mongodb.password=******
Eller
application.yml
:
spring:
data:
mongodb:
host: <hostname>
port: 27017
database: <dbname>
username: <usernamr>
password: ******