-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Add a helper for copying a database. Following the code I use to implement it to mongokit :
+ def copy_database(self, from_db, to_db, from_host=""):
+ command = [ ('copydb',1), ('fromdb',from_db), ('todb', to_db)]
+ if from_host:
+ command.append( ('fromhost',from_host) )
+ assert self.admin.command(SON(command))['ok']
It will be better to have it to pymongo as every third party lib can use this method.