title: CRUD in controller is not deleting row correctly
body: <p>I was able to create values and store into my db, which displays a view of the list of values stored and additional values that is written into a input will automatically show in the table. </p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@Controller
  public class AppPortController {
  
      private ApServerService apServerService;
  
      @Autowired
      public void setApServerService(ApServerService apServerService) {
          this.apServerService = apServerService;
      }
  
  @RequestMapping(value = "/editApServer", method = RequestMethod.GET)
  public String list(Model model) {
      model.addAttribute("apList", apServerService.listAllApServerModels());
      return "editApServer";
  }
  
  @RequestMapping("editApServer/update/{id}")
  public String update(@PathVariable String id, Model model) {
      model.addAttribute("apList", apServerService.getApServerModelById(id));
      return "editApServer";
  }
  
  @RequestMapping("editApServer/new")
  public String newServer(Model model){
      model.addAttribute("apServer", new ApServerModel());
      return "editApServer";
  }
  
  @RequestMapping(value = "/addServer", method = RequestMethod.POST)
  public String addServer(@ModelAttribute ApServerModel apServerModel) {
      apServerService.saveApServerModel(apServerModel);
  
      return "redirect:editApServer";
  }
  
  
  @RequestMapping("editApServer/delete")
  public String delete(@PathVariable String host){
      apServerService.deleteApServerModel(host);
  
      return "redirect:editApServer";
  }
  </code></pre>
  
  <p><strong>Repository</strong></p>
  
  <pre><code>public interface AppPortRepository extends CrudRepository&lt;ApServerModel, String&gt; {}
  </code></pre>
  
  <p><strong>POJO</strong></p>
  
  <pre><code>@Document(collection = "apDBServer")
  public class ApServerModel {
  
      @Id
      private String id;
      private String host;
      private String port;
  
  //getters and setters
  </code></pre>
  
  <p><strong>HTML SNIPPET</strong></p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt; Host Name &lt;/th&gt;
          &lt;th&gt; Port Name&lt;/th&gt;
          &lt;th&gt;Id&lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
  
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;tr th:each="ApServerModel : ${apList}"&gt;        
          &lt;td th:text ="${ApServerModel.host}"&gt;&lt;/td&gt;
          &lt;td th:text ="${ApServerModel.port}"&gt;&lt;/td&gt;
          &lt;td th:text ="${ApServerModel.id}"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a th:href="${'editApServer/update/' + ApServerModel.id}"&gt;Edit&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a th:href="${'editApServer/delete'}"&gt;Delete&lt;/a&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;br /&gt;
          &lt;h2&gt;Add AppPortServer&lt;/h2&gt;
          &lt;form action="/addServer" method="POST"&gt;
              Host &lt;input type="text" id="host" name="host" /&gt;&lt;br /&gt;
              Port &lt;input type="text" id="port" name="port" /&gt;&lt;br /&gt;
              &lt;input type="submit" /&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p><strong>Problem</strong> </p>
  
  <p>In my controller the delete would not execute(it is not doing what I want it to do). but line below it redirects me back to the same page.</p>
  
  <p>What am I doing wrong? I have been savaging through the internet trying to find the crud functions for mongodb using springboot. Logically speaking why wouldn't my delete work if I follow the logic of the create?</p>
  
  <p>I followed <a href="https://tests4geeks.com/spring-data-boot-mongodb-example/" rel="nofollow noreferrer">Tutorial</a>, for posting to a table. Then I followed 
  <a href="https://github.com/springframeworkguru/springbootwebapp/tree/part4/src/main/java/guru/springframework" rel="nofollow noreferrer">Tutorial 2</a> That implements my delete and update. But It does not delete the values.</p>