Class: MongoDbUtils::Tools::Restore

Inherits:
BaseCmd
  • Object
show all
Defined in:
lib/mongo-db-utils/tools/commands.rb

Instance Method Summary collapse

Methods inherited from BaseCmd

#run

Constructor Details

#initialize(host_and_port, db, source_folder, username = '', password = '') ⇒ Restore

Returns a new instance of Restore.



75
76
77
78
79
# File 'lib/mongo-db-utils/tools/commands.rb', line 75

def initialize(host_and_port,db,source_folder,username = '', password = '')
  super('mongorestore', host_and_port, db, username, password)
  add_option('--drop')
  @source_folder = source_folder
end

Instance Method Details

#cmdObject



81
82
83
# File 'lib/mongo-db-utils/tools/commands.rb', line 81

def cmd
  "#{super} #{@source_folder}"
end

#executable_cmdObject



85
86
87
# File 'lib/mongo-db-utils/tools/commands.rb', line 85

def executable_cmd
  "#{super} #{@source_folder}"
end