How to import/export all collections of the MongoDB database using mongodb java driver?

前端 未结 4 1333
臣服心动
臣服心动 2020-12-21 12:52

Is there any function to import and export all collections of mongodb database using java driver.? like there is mongodump and mongorestore using c

4条回答
  •  一向
    一向 (楼主)
    2020-12-21 13:32

    mongodump --host localhost --port 27017 --db sample    
    

    It exacts with folder as dump with database name sample

    mongorestore --db sample --verbose d:/dump/sample/
    

提交回复
热议问题