SpringBoot中如何集成MongoDB 1.首先添加maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </dependency>
2.添加nongoDB连接配置
spring.application.name=spirngboot-mongodb
spring.data.mongodb.database=admin
spring.data.mongodb.host=127.0.0.1
spring.data.mongodb.password=root
spring.data.mongodb.port=27017
spring.data.mongodb.username=root