Class: MongoDbUtils::Tools::Import

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

Instance Method Summary collapse

Methods inherited from BaseCmd

#cmd, #executable_cmd, #run

Constructor Details

#initialize(host_and_port, db, collection, file, username = '', password = '', opts = {}) ⇒ Import

Returns a new instance of Import.



91
92
93
94
95
96
97
# File 'lib/mongo-db-utils/tools/commands.rb', line 91

def initialize(host_and_port, db, collection, file, username = '', password = '', opts = {})
  super('mongoimport', host_and_port, db, username, password)
  add_option(o('-c', collection))
  add_option(o('--file', file))
  add_option('--jsonArray') if opts[:json_array]
  add_option('--drop') if opts[:drop]
end