code: def add_view(self, view_name, map_func, reduce_func=None, **kwargs):
          
          if self.get_view(view_name) is not None:
              raise CloudantArgumentError(107, view_name)
          if self.get('language', None) == QUERY_LANGUAGE:
              raise CloudantDesignDocumentException(101)
  
          view = View(self, view_name, map_func, reduce_func, **kwargs)
          self.views.__setitem__(view_name, view)
docs: Appends a MapReduce view to the locally cached DesignDocument View
          dictionary.  To create a JSON query index use
          :func:`~cloudant.database.CloudantDatabase.create_query_index` instead.
          A CloudantException is raised if an attempt to add a QueryIndexView
          (JSON query index) using this method is made.
  
          :param str view_name: Name used to identify the View.
          :param str map_func: Javascript map function.
          :param str reduce_func: Optional Javascript reduce function.