如何使用mongodb java驱动程序导入/导出MongoDB数据库的所有集合? [英] How to import/export all collections of the MongoDB database using mongodb java driver?

查看:495
本文介绍了如何使用mongodb java驱动程序导入/导出MongoDB数据库的所有集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何函数可以使用java驱动程序导入和导出mongodb数据库的所有集合。比如 mongodump mongorestore 使用命令提示符。

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

推荐答案

简短的回答是否定的。这些命令只能从命令行调用。
您可能会考虑从所有集合中获取所有数据,但预计会很慢。

The short answer is no. These commands can be invoked only from command line. You might consider to fetch all the data from all collections but its expected to be slow.

您可以阅读围绕此这里

希望这会有所帮助

这篇关于如何使用mongodb java驱动程序导入/导出MongoDB数据库的所有集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆