lib/mongo/mongo.rb
# Returns a hash containing database names as keys and disk space for
# each as values.
Returns a hash containing database names as keys and disk space for
each as values.
Returns a hash containing database names as keys and disk space for each as values .
def database_info
          doc = single_db_command('admin', :listDatabases => 1)
          h = {}
          doc['databases'].each { |db|
            h[db['name']] = db['sizeOnDisk'].to_i
          }
          h
        end
def database_info doc = single_db_command ( 'admin' , :listDatabases => 1 ) h = { } doc [ 'databases' ] . each { | db | h [ db [ 'name' ] ] = db [ 'sizeOnDisk' ] . to_i } h end
Returns a hash containing database names as keys and disk space for
each as values.
Returns a hash containing database names as keys and disk space for each as values .