springboot-bucket/springboot-mongodb/README.md
2018-09-15 13:49:05 +08:00

37 lines
791 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 集成MongoDB
SpringBoot集成MongoDB访问NoSQL数据库
## 安装MongoDB数据库
数据库的安装教程网上非常多我在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
修改配置文件主要是MongoDB的连接信息
## 运行测试用例
执行对用户表增/删/改/查的测试用例:`com.xncoding.pos.ApplicationTests.java`
## 许可证
Copyright (c) 2018 Xiong Neng
基于 MIT 协议发布: <http://www.opensource.org/licenses/MIT>