title: mongoose - Delete element by id
body: <p>I am trying to delete a specific property by passing the id of the property, however, the delete removes the first property in the database and not the specific one. </p>
  
  <p><strong>Server.js</strong></p>
  
  <pre><code>app.delete('/deleteProperty/:id', function(req,res) {
    Property.findOneAndRemove(req.params.propertyId,req.body, function(err,data) {
        if(!err) {
          console.log("Deleted");
        }
    });
  });
  </code></pre>
  
  <p><strong>api.service.ts</strong></p>
  
  <pre><code>deleteProperty(id:number) {
          return this.http.delete('http://localhost:3000/deleteProperty/'+id)
          .do(data =&gt; console.log('All: ' + JSON.stringify(data)))
          .catch(this.handleError);
      }
  </code></pre>
  
  <p><strong>propertyDetail.component.ts</strong></p>
  
  <pre><code>deleteProperty(id)
      {
          this.apiService.deleteProperty(id)
          .subscribe( res =&gt; {
             //        this._router.navigate(['/properties']);
          }, (err) =&gt; {
              console.log(err);
          }
          )
      }
  </code></pre>
  
  <p><strong>Button in html</strong></p>
  
  <pre><code>&lt;a style="float:right"  color="warn" mat-raised-button (click)="deleteProperty(property.propertyId)"&gt;Delete&lt;/a&gt;
  </code></pre>