code: public boolean mergeWith(DesignDocument dd, boolean updateOnDiff) {
          boolean changed = mergeViews(dd.views(), updateOnDiff);
          changed = mergeFunctions(lists(), dd.lists(), updateOnDiff) || changed;
          changed = mergeFunctions(shows(), dd.shows(), updateOnDiff) || changed;
          changed = mergeFunctions(filters(), dd.filters(), updateOnDiff) || changed;
          changed = mergeFunctions(updates(), dd.updates(), updateOnDiff) || changed;
          return changed;
      }
docs: Merge this design document with the specified document, the result being
  stored in this design document.
  
  @param dd
  the design document to merge with
  @param updateOnDiff
  true to overwrite existing views/functions in this document
  with the views/functions in the specified document; false will
  only add new views/functions.
  @return true if there was any modification to this document, false otherwise.