/** * @before */ protected function setUpMongoClient() { $client = new Client(); $this->database = $client->selectDatabase('yadm_test'); foreach ($this->database->listCollections() as $collectionInfo) { if ('system.indexes' == $collectionInfo->getName()) { continue; } $this->database->dropCollection($collectionInfo->getName()); } }
/** * Drops a collection * * @link http://www.php.net/manual/en/mongodb.dropcollection.php * @param MongoCollection|string $coll MongoCollection or name of collection to drop. * @return array Returns the database response. * * @deprecated Use MongoCollection::drop() instead. */ public function dropCollection($coll) { if ($coll instanceof MongoCollection) { $coll = $coll->getName(); } return TypeConverter::toLegacy($this->db->dropCollection((string) $coll)); }
/** * (PECL mongo >= 0.9.0)<br/> * @deprecated Use MongoCollection::drop() instead. * Drops a collection * @link http://www.php.net/manual/en/mongodb.dropcollection.php * @param MongoCollection|string $coll MongoCollection or name of collection to drop. * @return array Returns the database response. */ public function dropCollection($coll) { return $this->db->dropCollection((string) $coll); }