Skip to content

A demo project showcasing Spring Boot with MongoDB integration.

License

Notifications You must be signed in to change notification settings

albatranomar/springboot-mongodb-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springboot-mongodb-demo

A demo project showcasing Spring Boot with MongoDB integration.

Run Locally

Clone the project

  git clone https://github.com/albatranomar/springboot-mongodb-demo.git

Go to the project directory

  cd springboot-mongodb-demo

Start mongodb server (Docker)

  docker run -d --name mongo-demo -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=adminadmin -p 27017:27017 -v mongodemo:/data/db mongo:7.0
  • MONGO_INITDB_ROOT_USERNAME: mongoadmin
  • MONGO_INITDB_ROOT_PASSWORD: adminadmin

Update your application.properties to match this

spring.application.name=demonosql

spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=demoSpring
spring.data.mongodb.username=mongoadmin
spring.data.mongodb.password=adminadmin
spring.data.mongodb.authentication-database=admin

You are ready to go!

About

A demo project showcasing Spring Boot with MongoDB integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages