|
|
@@ -655,12 +655,7 @@ class MongoCollection
|
|
|
try {
|
|
|
return TypeConverter::toLegacy($this->collection->dropIndex($indexName));
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- return [
|
|
|
- 'nIndexesWas' => count($this->getIndexInfo()),
|
|
|
- 'errmsg' => $e->getMessage(),
|
|
|
- 'ok' => 0.0,
|
|
|
- 'code' => $e->getCode(),
|
|
|
- ];
|
|
|
+ return ExceptionConverter::toResultArray($e) + ['nIndexesWas' => count($this->getIndexInfo())];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -672,7 +667,11 @@ class MongoCollection
|
|
|
*/
|
|
|
public function deleteIndexes()
|
|
|
{
|
|
|
- return TypeConverter::toLegacy($this->collection->dropIndexes());
|
|
|
+ try {
|
|
|
+ return TypeConverter::toLegacy($this->collection->dropIndexes());
|
|
|
+ } catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
+ return ExceptionConverter::toResultArray($e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|