BackUp and restore db with MongoDB java driver -


is there possibility in mongodb java driver make backup , restore db?

my solution (just execute command) now:

public void makebackup(string path) {     try {         runtime.getruntime().exec("mongodump --out " + path);     } catch (ioexception ex) {         logger.getlogger(mongodb.class.getname()).log(level.severe, null, ex);     }  }  public void restore(string backuppath) {     try {         runtime.getruntime().exec("mongorestore " + backuppath);     } catch (ioexception ex) {         logger.getlogger(mongodb.class.getname()).log(level.severe, null, ex);     } } 

thanks in advance.

the short answer no @ now. these commands can invoked command line. might consider fetch data collections expected slow. can read discussion around here


Comments

Popular posts from this blog

Sass watch command compiles .scss files before full sftp upload -

filehandler - java open files not cleaned, even when the process is killed -

gridview - Yii2 DataPorivider $totalSum for a column -