完成springboot-mongodb升级重构
This commit is contained in:
parent
1e578567b0
commit
62a79fa73e
@ -4,9 +4,22 @@ SpringBoot集成MongoDB访问NoSQL数据库
|
||||
|
||||
## 安装MongoDB数据库
|
||||
|
||||
数据库的安装教程网上非常多,参考 [官网安装](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/)
|
||||
数据库的安装教程网上非常多,我在CentOS7上面安装,版本是4.0
|
||||
参考了 [官网安装](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/)
|
||||
|
||||
配置数据库的账号和密码。
|
||||
安装完成后,配置数据库的账号和密码:
|
||||
|
||||
```
|
||||
mongo --port 27017
|
||||
use test
|
||||
db.createUser(
|
||||
{
|
||||
user: "xiongneng",
|
||||
pwd: "123456",
|
||||
roles: [ { role: "readWrite", db: "test" } ]
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## 修改application.yml
|
||||
|
||||
@ -16,7 +29,6 @@ SpringBoot集成MongoDB访问NoSQL数据库
|
||||
|
||||
执行对用户表增/删/改/查的测试用例:`com.xncoding.pos.ApplicationTests.java`
|
||||
|
||||
|
||||
## 许可证
|
||||
|
||||
Copyright (c) 2018 Xiong Neng
|
||||
|
@ -23,23 +23,4 @@ logging:
|
||||
ROOT: INFO
|
||||
com:
|
||||
xncoding: DEBUG
|
||||
file: E:/logs/app.log
|
||||
|
||||
---
|
||||
|
||||
#####################################################################
|
||||
######################## 测试环境profile ##########################
|
||||
#####################################################################
|
||||
|
||||
spring:
|
||||
profiles: test
|
||||
data:
|
||||
mongodb:
|
||||
uri: mongodb://xiongneng:123456@localhost:27017/test
|
||||
|
||||
logging:
|
||||
level:
|
||||
ROOT: INFO
|
||||
com:
|
||||
xncoding: DEBUG
|
||||
file: /var/logs/app.log
|
||||
file: D:/logs/app.log
|
||||
|
Loading…
Reference in New Issue
Block a user