code: private View compileView(String viewName, Map<String, Object> viewProps) {
          String language = (String) viewProps.get("language");
          if (language == null) {
              language = "javascript";
          }
          String mapSource = (String) viewProps.get("map");
          if (mapSource == null) {
              return null;
          }
          Mapper mapBlock = View.getCompiler().compileMap(mapSource, language);
          if (mapBlock == null) {
              Log.w(TAG, "View %s has unknown map function: %s", viewName, mapSource);
              return null;
          }
          String reduceSource = (String) viewProps.get("reduce");
          Reducer reduceBlock = null;
          if (reduceSource != null) {
              reduceBlock = View.getCompiler().compileReduce(reduceSource, language);
              if (reduceBlock == null) {
                  Log.w(TAG, "View %s has unknown reduce function: %s", viewName, reduceBlock);
                  return null;
              }
          }
  
          String version = Misc.HexSHA1Digest(viewProps.toString().getBytes());
  
          View view = db.getView(viewName);
          view.setMapReduce(mapBlock, reduceBlock, version);
          String collation = (String) viewProps.get("collation");
          if ("raw".equals(collation)) {
              view.setCollation(View.TDViewCollation.TDViewCollationRaw);
          }
          view.setDesignDoc(true);
  
          return view;
      }
docs: VIEW QUERIES: *