Question: Go to: https://start.spring.io/ Choose Maven 2.7.8 Select Jar and Java 17 Add the following dependencies: Spring Data MongoDB Spring Web Spring Boot DevTools Generate the
Go to:
https://start.spring.io/
Choose
Maven
2.7.8
Select Jar and Java 17
Add the following dependencies:
Spring Data MongoDB
Spring Web
Spring Boot DevTools
Generate the project and open it in IntelliJ
Start by creating a new package for Models. In your Models package, you create a new class and
naming it User.
A user must have the following fields
String id
String username
String email
String password
The username, email and password fields must be filled in. You can use annotations to
achieve it. Also set a maximum value for the number of characters in the fields, you also solve it with
annotations.
Create constructors, getters and setters for User.
You must be able to perform the following HTTP methods on your User model:
POST: create a new user and save in the database
GET: retrieve ALL users in the database
GET: get ONE user in the database
PUT: update a user's information and save in the database
DELETE: remove a user from the database
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
