【问题标题】:How to run migration script from "HEROKU" to insert data in MongoDB?如何从“HEROKU”运行迁移脚本以在 MongoDB 中插入数据?
【发布时间】:2015-12-01 11:05:23
【问题描述】:

我在 Heroku 上部署了我的应用,运行良好。

现在,我想从迁移文件夹运行迁移脚本以在 mongoDB 数据库中插入一些信息。

那些迁移脚本在本地成功运行并在 mongoDB 数据库中插入信息。

如何在 heroku 上运行?

【问题讨论】:

    标签: angularjs node.js mongodb heroku mean.io


    【解决方案1】:

    你可以像这样在 Heroku 上运行任意脚本:

    heroku run node foobar.js
    

    例如:

    heroku run node db/migrate.js
    

    请确保您的脚本遵循与您的应用相同的连接变量(MONGOLAB_URL、DATABASE_URL 等)。

    【讨论】:

      猜你喜欢
      • 2013-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-07
      • 2015-09-21
      • 2017-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多