Run MongoDump / MongoRestore in C#

萝らか妹 提交于 2019-12-24 09:02:28

问题


Is there an easy way to run these commands using the C# driver? The only documentation I found involves running the EXE as a process etc, which seems a bit heavy.

The only related question I found was unanswered... am I missing something fundamental here?

http://grokbase.com/t/gg/mongodb-user/127zntq9pr/mongodump-in-c


回答1:


mongodump and mongorestore are applications, not MongoDB commands which is why you would have to run the executable.

If interested, the C++ code for dumping a database is located here.




回答2:


unfortunately nope. I think that easier way to do regular backup of your mongodb is to write backup script and to create task in scheduler. nice answer how to do this you can find here: MongoDB script to backup replication set locally to a Windows Server if there are simpler solutions I'll be happy to know about them -- this problem is actual for me too. :)



来源:https://stackoverflow.com/questions/16716407/run-mongodump-mongorestore-in-c-sharp

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