This repository contains a Spring Boot example project for MongoDB.
For a code review of this repo, see my related blog post.
You can learn more about my (John Thompson - Springframework Guru) courses here on my site.
Java 17 LTS / spring-boot 2.6.6 / bootstrap 4.6.1 / jquery 3.6.0 / single module version ...
- Run/prepare docker image and container
docker run -p 27017:27017 --name spring-mongo -d mongo:5.0.7
- Start MongoDB console in interactive mode (if you need it)
docker exec -it spring-mongo mongosh
-
Start application with maven target sequence
clean
thenpackage
orinstall
andspring-boot:start
orspring-boot:run
-
Open web-app inside a browser on localhost and port
8080
-
Stop application when needed with maven target
spring-boot:stop