This is a very basic demo that showcases Spring Data MongoDB. This is a RESTFul app which exposes 2 GET endpoints:
/load : This endpoint loads 3 users data into mongodb
/users : This endpoint returns the list of users in the database
The app uses an embedded mongodb so no need for an additional setup.
The only requirement here is Java 21. I highly suggested you use SDK Man to manage your local Java versions.
On the command line simply run:
- Clone this repo
git clone https://github.com/schabiyo-eng/spring-mdb-demo-101.git- cd into the root directory
cd spring-mdb-demo-101- Run the app
./gradlew bootRun
For further reference, please consider the following sections:
