Spring Boot rest API application with MongoDB.
In the application.properties file change the mongoDB URI link with your mongoDB Atlas SRV Connnection String. Change the database cluster name to something else if you want.
Configure your application (file application properties) with the "MONGODB (MongoProperties)"
spring.data.mongodb.host= # the db host
spring.data.mongodb.port=27017 # the connection port (defaults to 27107)
spring.data.mongodb.uri=mongodb://localhost/test # connection URL
spring.data.mongodb.database=
spring.data.mongodb.authentication-database=
spring.data.mongodb.grid-fs-database=
spring.data.mongodb.username=
spring.data.mongodb.password=
spring.data.mongodb.repositories.enabled=true # if spring data repository support is enabled
Online Postman API documentation : https://documenter.getpostman.com/view/1700165/Rzfaqr8i
HEADERS Content-Type application/json
BODY
{
"id": "5bf94984b7bca66999999999",
"description": "Make again the EL exercise"
}
HEADERS Content-Type application/json
BODY
{
"id": "5bf94984b7bca66999999999",
"description": "Make correction of the EL exercise"
}
HEADERS Content-Type application/json
BODY
{
"id": "5bf91318b7bca65dc51bef0d",
"firstName": "JP",
"lastName": "Dupont",
"tasks": [
{
"id": "sdfsdfsdsd",
"description": "Review EL exercise"
}
]}
HEADERS Content-Type application/json
BODY
{
"id": "5bf91318b7bca65dc51bef0d",
"firstName": "Jean-Phillippe",
"lastName": "Dupont",
"tasks": [
{
"id": "sdfsdfsdsd",
"description": "Review EL exercise"
}]
}
POST http://localhost:8080/users/assigntask/{userId}/{taskId}