Method: Mongo::Connection#database_info
- Defined in:
- lib/jmongo/connection.rb
#database_info ⇒ Hash
Return a hash with all database names and their respective sizes on disk.
138 139 140 141 142 143 |
# File 'lib/jmongo/connection.rb', line 138 def database_info doc = self['admin'].command({:listDatabases => 1}) doc['databases'].each_with_object({}) do |db, info| info[db['name']] = db['sizeOnDisk'].to_i end end |