Skip to content

Commit 62a79fa

Browse files
author
Xiong Neng
committed
完成springboot-mongodb升级重构
1 parent 1e57856 commit 62a79fa

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

springboot-mongodb/README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@ SpringBoot集成MongoDB访问NoSQL数据库
44

55
## 安装MongoDB数据库
66

7-
数据库的安装教程网上非常多,参考 [官网安装](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/)
8-
9-
配置数据库的账号和密码。
7+
数据库的安装教程网上非常多,我在CentOS7上面安装,版本是4.0
8+
参考了 [官网安装](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/)
9+
10+
安装完成后,配置数据库的账号和密码:
11+
12+
```
13+
mongo --port 27017
14+
use test
15+
db.createUser(
16+
{
17+
user: "xiongneng",
18+
pwd: "123456",
19+
roles: [ { role: "readWrite", db: "test" } ]
20+
}
21+
)
22+
```
1023

1124
## 修改application.yml
1225

@@ -16,7 +29,6 @@ SpringBoot集成MongoDB访问NoSQL数据库
1629

1730
执行对用户表增/删/改/查的测试用例:`com.xncoding.pos.ApplicationTests.java`
1831

19-
2032
## 许可证
2133

2234
Copyright (c) 2018 Xiong Neng

springboot-mongodb/src/main/resources/application.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,4 @@ logging:
2323
ROOT: INFO
2424
com:
2525
xncoding: DEBUG
26-
file: E:/logs/app.log
27-
28-
---
29-
30-
#####################################################################
31-
######################## 测试环境profile ##########################
32-
#####################################################################
33-
34-
spring:
35-
profiles: test
36-
data:
37-
mongodb:
38-
uri: mongodb://xiongneng:123456@localhost:27017/test
39-
40-
logging:
41-
level:
42-
ROOT: INFO
43-
com:
44-
xncoding: DEBUG
45-
file: /var/logs/app.log
26+
file: D:/logs/app.log

0 commit comments

Comments
 (0)