GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SpringBootBucket/springboot-mongodb at master · zhangjia/SpringBootBucket

Expand file tree

/

springboot-mongodb

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

springboot-mongodb

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 
run.sh
run.sh
 
 

README.md

Outline

集成MongoDB

SpringBoot集成MongoDB访问NoSQL数据库

安装MongoDB数据库

数据库的安装教程网上非常多,我在CentOS7上面安装,版本是4.0 参考了 官网安装

安装完成后,配置数据库的账号和密码:

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

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.