lib/mongoid/shell/commands/mongorestore.rb in mongoid-shell-0.2.0 vs lib/mongoid/shell/commands/mongorestore.rb in mongoid-shell-0.3.0
- old
+ new
@@ -1,20 +1,24 @@
module Mongoid
module Shell
module Commands
class Mongorestore < Mongoid::Shell::Commands::Base
- include Mongoid::Shell::Properties::Host
+ include Mongoid::Shell::Properties::Primary
include Mongoid::Shell::Properties::Database
include Mongoid::Shell::Properties::Username
include Mongoid::Shell::Properties::Password
- attr_accessor :collection, :ipv6, :dbpath, :directoryperdb, :journal, :objcheck, :filter, :drop, :oplogReplay, :keepIndexVersion, :restore
+ attr_accessor :host, :collection, :ipv6, :dbpath, :directoryperdb, :journal, :objcheck, :filter, :drop, :oplogReplay, :keepIndexVersion, :noIndexRestore, :restore
def initialize(attrs = {})
super
end
+ def host
+ @host || primary
+ end
+
def vargs
super({
'--host' => :host,
'--db' => :db,
'--username' => :username,
@@ -27,13 +31,13 @@
'--objcheck' => :objcheck,
'--filter' => :filter,
'--drop' => :drop,
'--oplogReplay' => :oplogReplay,
'--keepIndexVersion' => :keepIndexVersion,
+ '--noIndexRestore' => :noIndexRestore,
'directory or filename to restore from' => :restore
})
end
-
end
end
end
end