你知道清理heroku/mongohq数据库的方法吗?
我正在寻找一种方法来重置部署在heroku/mongohq上的mongodb,比如 #heroku rake db:reset 我知道可以直接登录 mongohq 并将其删除,但我想要一个快速的命令行。
提前致谢 卢卡
I'm looking for a way to reset a mongodb deploied on heroku/mongohq, something like# heroku rake db:reset
I know that's possible to directly login mongohq and drop it, but I'd like a quick command line.
Thanks in advance
Luca
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在你的标题中你说“清理”,在你的描述中你说“重置”。您还可以使用“drop”一词,就好像您要删除数据库一样。
。rake 是一个构建工具,这些都是数据库管理的功能。
您能更具体地说明您想要做什么吗?
好吧,所以我找到了一些 更多细节。看起来 rake:reset 执行了以下操作:
因此,它执行删除、创建和架构加载。这些都是 Rails 特定的任务,并且都与 SQL 数据库的某些特定功能相关。
一般来说,MongoDB 没有模式,因此通常不需要
db:create
和db:schema:load
。所以基本上你只是在执行db:drop
(也许还有一些ensureIndex
命令)?我正在研究其余的 rake 任务,其中许多任务并不真正适用于典型的 MongoDB 用例。如果您确实想要此功能,您可能需要自己编写一些内容。
In your title you say "clean up", in your description you say "reset". You also use the word "drop" as if you want to drop a database.
rake
is a build tool and these are all functions of DB administration.Would you be able to be more specific about what you're trying to do?
Alright, so I found some more details. It looks like
rake:reset
does the following:So, it does a drop, a create and a schema load. These are all Rails-specific tasks and they're all tied to some specific features of SQL databases.
In general, MongoDB doesn't have a schema, so there's normally no need for
db:create
anddb:schema:load
. So basically you're just doing adb:drop
(and maybe someensureIndex
commands)?I'm looking at the rest of these rake tasks, and many of them don't really apply to typical MongoDB use cases. If you really want this functionality, you'll probably have to write some of this for yourself.