【问题标题】:How to insert data to MongoDB when using meteor使用流星时如何向MongoDB插入数据
【发布时间】:2015-12-07 22:36:39
【问题描述】:

我在使用 MongoDB 和 Meteor(使用 Webstorm 10)时遇到问题。

您知道执行“种子”迁移的好方法吗?

我听说过 Mongo Plugin ,但该插件的互联网文档很差,我就是不明白如何使用 MongoExplorer。

有什么建议吗?

【问题讨论】:

    标签: mongodb meteor webstorm


    【解决方案1】:

    在应用程序启动时插入一些数据非常简单:Insert data in collection at Meteor's startuphttp://eureka.ykyuen.info/2015/02/19/meteor-insert-sample-data-if-the-mongodb-is-empty/

    如果您想将架构从 X 版编辑到 Y 版,您可以查看这个现有的 Meteor 项目:https://github.com/wekan/wekan/blob/devel/server/migrations.js

    如果您正在寻找很棒的模式来进行迁移(种子、回滚等),这是一个很棒的模式(但在 PHP 中):http://laravel.com/docs/5.1/migrations

    【讨论】:

      猜你喜欢
      • 2014-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-03
      • 2017-02-21
      • 1970-01-01
      • 2017-12-15
      • 1970-01-01
      相关资源
      最近更新 更多