lib/Doctrine/CouchDB/MangoClient.php
public function createMangoIndex($fields, $ddoc = null, $name = null)
  {
      $documentPath = '/'.$this->databaseName.'/_index';

      $params = ['index'=>['fields'=>$fields]];

      if ($ddoc) {
          $params['ddoc'] = $ddoc;
      }
      if ($name) {
          $params['name'] = $name;
      }

      return $this->httpClient->request('POST', $documentPath, json_encode($params));
  }
public function createMangoIndex($fields, $ddoc = null, $name = null)
  {
      $documentPath = '/'.$this->databaseName.'/_index';

      $params = ['index'=>['fields'=>$fields]];

      if ($ddoc) {
          $params['ddoc'] = $ddoc;
      }
      if ($name) {
          $params['name'] = $name;
      }

      return $this->httpClient->request('POST', $documentPath, json_encode($params));
  }
public function createMangoIndex ( $ fields , $ ddoc = null , $ name = null ) { $ documentPath = '/' . $ this -> databaseName . '/_index' ; $ params = [ 'index' => [ 'fields' => $ fields ] ] ; if ( $ ddoc ) { $ params [ 'ddoc' ] = $ ddoc ; } if ( $ name ) { $ params [ 'name' ] = $ name ; } return $ this -> httpClient -> request ( 'POST' , $ documentPath , json_encode ( $ params ) ) ; }
Create a mango query index and return the HTTP response.

@param array  $fields - index fields
@param string $ddoc   - design document name
@param string $name   - view name
Create a mango query index and return the HTTP response .