protected function cleanupMongo()
    {
        try {
            $list = $this->dbh->listCollections();
        } catch (\MongoException $e) {
            throw new \Exception(sprintf('Failed to list collections of the DB: %s', $e->getMessage()));
        }
        foreach ($list as $collection) {
            try {
                $collection->drop();
            } catch (\MongoException $e) {
                throw new \Exception(sprintf('Failed to drop collection: %s', $e->getMessage()));
            }
        }
    }
protected function cleanupMongo()
    {
        try {
            $list = $this->dbh->listCollections();
        } catch (\MongoException $e) {
            throw new \Exception(sprintf('Failed to list collections of the DB: %s', $e->getMessage()));
        }
        foreach ($list as $collection) {
            try {
                $collection->drop();
            } catch (\MongoException $e) {
                throw new \Exception(sprintf('Failed to drop collection: %s', $e->getMessage()));
            }
        }
    }
protected function cleanupMongo ( ) { try { $ list = $ this -> dbh -> listCollections ( ) ; } catch ( \ MongoException $ e ) { throw new \ Exception ( sprintf ( 'Failed to list collections of the DB: %s' , $ e -> getMessage ( ) ) ) ; } foreach ( $ list as $ collection ) { try { $ collection -> drop ( ) ; } catch ( \ MongoException $ e ) { throw new \ Exception ( sprintf ( 'Failed to drop collection: %s' , $ e -> getMessage ( ) ) ) ; } } }
Clean up the Mongo database using the legacy Mongo extension.
Clean up the Mongo database using the legacy Mongo extension .