ruby - How to clone one database to another? -
i want clone 1 database in mongodb using 'mongo' gem.
i can in mongodb console this:
db.copydatabase(fromdb, todb, fromhost, username, password)
so, there way using gem?
solution:
@connection = mongo::mongoclient.new @connection.copy_database('from', 'to') => {"ok"=>1.0}
ruby mongodb gem
No comments:
Post a Comment