Export and Import Mongodb from Meteor APP

孤者浪人 提交于 2019-12-10 10:37:37

问题


How is it possible to Import and export the MongoDB from Meteor APP into .json or .csv file ?


回答1:


You can use mongoexport utility to export into a .json or .csv file and mongoimport to import to your db. Detailed info is found here: http://docs.mongodb.org/v2.2/reference/mongoexport/




回答2:


If you intend to reimport into mongodb, mongodump might be a bit better since you won't be losing type information

Try mongodump

mongodump --host 127.0.0.1:3001

Here you get BSON, and separate key indexes in json files. Then you can use the dumps to restore your db (if this is your intention):

If you're in the dump directory from above:

mongorestore --host 128.199.224.29:27017 --db meteor .


来源:https://stackoverflow.com/questions/24551626/export-and-import-mongodb-from-meteor-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!