code: function (req, res) {
      if (req.body._id) {
        delete req.body._id;
      }
  
      var self = this;
      var bodyData = _.omit(req.body, this.omit);
  
      this.model.findOne({'_id': req.params[this.idName]}, function (err, document) {
        if (err) {
          return res.handleError(err);
        }
  
        if (!document) {
          return res.notFound();
        }
  
        var updated = _.merge(document, bodyData);
        var populations = self.filterPopulations('update');
  
        updated.populate(populations, function(err, document) {
          if (err) {
            return res.handleError(err);
          }
  
          document.save(function (err) {
            if (err) {
              return res.handleError(err);
            }
  
            return res.ok(self.getResponseObject(document));
          });
        });
  
      });
    }
docs: Updates an existing document in the DB. The requested document id is read from the
  request parameters by using the {@link CrudController#idName} property.
  @param {IncomingMessage} req - The request message object the id is read from
  @param {ServerResponse} res - The outgoing response object
  @returns {ServerResponse} The updated document or NOT FOUND if no document has been found