code: function update (req, res, next) {
      for (var key in req.body) {
        req.body[key] = utils.toNative(req.body[key])
      }
  
      var id = utils.toNative(req.params.id)
      var chain = db.get(name)
  
      chain = req.method === 'PATCH'
        ? chain.updateById(id, req.body)
        : chain.replaceById(id, req.body)
  
      var resource = chain.value()
  
      if (resource) {
        res.locals.data = resource
      }
  
      next()
    }
docs: PUT /name/:id PATCH /name/:id