Module: Mongo::DBExt

Defined in:
lib/mongo/driver/database.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(collection_name) ⇒ Object (protected)



14
15
16
# File 'lib/mongo/driver/database.rb', line 14

def method_missing collection_name
  self.collection collection_name
end

Instance Method Details

#clearObject



6
7
8
9
10
11
# File 'lib/mongo/driver/database.rb', line 6

def clear
  collection_names.each do |name|
    next if name =~ /^system\./
    mongo.db.collection(name).drop
  end
end

#dropObject



2
3
4
# File 'lib/mongo/driver/database.rb', line 2

def drop
  connection.drop_database name
end