2021
05-23
05-23
SpringBoot整合MongoDB的步骤详解
项目结构:1.pom引入mongodb依赖<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-mongodb</artifactId></dependency>2配置application.properties#spring.data.mongodb.host=127.0.0.1#spring.data.mongodb.port=27017#spring.data.mongodb.database=books###这种类似于关系型数据库url配置spring.data.mongodb.uri=mongodb://127.0.0.1:27017/books3.创建mongodb文档映射实体类@...
继续阅读 >