예제 #1
0
파일: Mongo.php 프로젝트: webiny/mongo
 public function createIndex($collectionName, IndexInterface $index, array $options = [])
 {
     return $this->bridge->createIndex($this->cName($collectionName), $index->getFields(), $index->getOptions() + $options);
 }
예제 #2
0
 /**
  * Create mongo index
  *
  * @param string         $collectionName Target collection
  * @param IndexInterface $index          Index object
  *
  * @return MongoResult
  */
 public function createIndex($collectionName, IndexInterface $index)
 {
     $collectionName = $this->collectionPrefix . $collectionName;
     $result = $this->driver->ensureIndex($collectionName, $index->getFields(), $index->getOptions());
     return $this->mongoResult('ensureIndex', $result);
 }