Is there any function to import and export all collections of mongodb database using java driver.? like there is mongodump and mongorestore using c
mongodump
mongorestore
Well as of now, Mongo Java driver does not support this.
You can try invoking the mongoimport and mongorestore commands from Java Runtime. Like
Runtime.getRuntime().exec("mongoimport -d -h <>..");