@ -165,7 +165,7 @@ class Collection extends Object
try {
$result = $this->mongoCollection->deleteIndexes();
$this->tryResultError($result);
return $result['nIndexesWas'] - 1;
return $result['nIndexesWas'];
} catch (\Exception $e) {
Yii::endProfile($token, __METHOD__);
throw new Exception($e->getMessage(), (int)$e->getCode(), $e);
@ -270,7 +270,7 @@ class CollectionTest extends MongoTestCase
{
$collection = $this->getConnection()->getCollection('customer');
$collection->createIndex('name');
$this->assertEquals(1, $collection->dropAllIndexes());
$this->assertEquals(2, $collection->dropAllIndexes());
$indexInfo = $collection->mongoCollection->getIndexInfo();
$this->assertEquals(1, count($indexInfo));
}