Skip to content

Commit

Permalink
Design Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaramsingana committed May 31, 2021
1 parent 9c41a05 commit cddf95d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,42 +169,42 @@ Now try to access application from a browser or use cUrl or Postman or any other
# Add Employee
Use below command for adding employee

curl --header "Content-Type: application/json" --request POST --data '{
`curl --header "Content-Type: application/json" --request POST --data '{
"name": "john",
"dept": "Techline",
"age": "28"
}
' http://mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/add
' http://mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/add `

`Output/Response: {"id":"60af3e15f427b06c8c2d6430","name":"john","dept":"Techline","age":28}`

# Update Employee by ID:
use below command for updating employee using id generated by application

curl --header "Content-Type: application/json" --request PUT --data '{
`curl --header "Content-Type: application/json" --request PUT --data '{
"name": "john",
"dept": "Programmer"
}
' http://mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/update/60af3e15f427b06c8c2d6430
' http://mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/update/60af3e15f427b06c8c2d6430`

# Get Employee Details by ID:
Get Employee Details using ID of an employee using below command

curl mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/getDetails/60af3e15f427b06c8c2d6430
`curl mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/getDetails/60af3e15f427b06c8c2d6430`

`{"id":"60af3e15f427b06c8c2d6430","name":"john","dept":"Programmer","age":28}`

# Remove Employee:
Remove employee by using ID

curl mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/remove/60af3e15f427b06c8c2d6430
`curl mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/remove/60af3e15f427b06c8c2d6430`

`Employee removed`

# Get All Employees:
Get all the employees

curl mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/list
`curl mongo-collections-sivaram.apps.p1299.cecc.ihost.com/employee/list`
```
[{"id":"60af3dc9f427b06c8c2d642f","name":"Sivaram","dept":"Techline","age":28},
{"id":"60af4279f427b06c8c2d6431","name":"joe","dept":"Sales","age":34},
Expand Down Expand Up @@ -246,13 +246,14 @@ The server generated these startup warnings when booting:
---
```
Switch to database which you have specified in application.properties file and check for collections available in database
`
```
MongoDB Enterprise > use testdb
switched to db testdb
MongoDB Enterprise > show collections
customer
employee
user `
user
```

Now verify all the details from employee collection

Expand Down

0 comments on commit cddf95d

Please sign in to comment.