Revisions

gist: 225246 Download_button fork
public
Public Clone URL: git://gist.github.com/225246.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
module Mongo
  class Connection
    def copyDatabase( from, to, host="localhost" )
      oh = OrderedHash.new
      oh[:copydb]= 1
      oh[:fromhost] = host
      oh[:fromdb] = from
      oh[:todb] = to
      single_db_command('admin', oh)
    end
  end
end