def list_databases(filter = {}, name_only = false, opts = {})
      cmd = { listDatabases: 1 }
      cmd[:nameOnly] = !!name_only
      cmd[:filter] = filter unless filter.empty?
      use(Database::ADMIN).command(cmd, opts).first[Database::DATABASES]
    end
def list_databases(filter = {}, name_only = false, opts = {})
      cmd = { listDatabases: 1 }
      cmd[:nameOnly] = !!name_only
      cmd[:filter] = filter unless filter.empty?
      use(Database::ADMIN).command(cmd, opts).first[Database::DATABASES]
    end
Get info for each database.

 @example Get the info for each database.
   client.list_databases

 @param [ Hash ] filter The filter criteria for getting a list of databases.
 @param [ true, false ] name_only Whether to only return each database name without full metadata.
 @param [ Hash ] opts The command options.

 @return [ Array<Hash> ] The info for each database.

 @since 2.0.5