code: function copyDoc (docSrc, docDest, opts0, callback0) {
        const { opts, callback } = getCallback(opts0, callback0)
  
        const qs = {
          db: dbName,
          doc: docSrc,
          method: 'COPY',
          headers: { 'Destination': docDest }
        }
  
        if (opts.overwrite) {
          const p = headDoc(docDest).then(
            function (h) {
              if (h.etag) {
                qs.headers.Destination += '?rev=' +
                  h.etag.substring(1, h.etag.length - 1)
              }
              relax(qs, callback)
            },
            function (e) {
              if (e && e.statusCode !== 404) {
                if (callback) {
                  callback(e)
                } else {
                  return Promise.reject(e)
                }
              } else {
                relax(qs, callback)
              }
            }
          )
          if (!callback) {
            return p
          }
        } else {
          return relax(qs, callback)
        }
      }
docs: http://docs.couchdb.org/en/latest/api/document/common.html#copy--db-docid