code: function merge (schema, options) {
    options = options || {}
    
    schema.method('merge', function (doc) {
      var self = this
      schema.eachPath(function (name) {
        var val = nestedPath(doc, name)
        // Merge all set fields, except for the ObjectID
        if (name !== '_id' && val !== undefined) {
          nestedPath(self, name, val)
        }
      })
      return this
    })
  }
docs: Plugin