使用流星时如何向 MongoDB 插入数据

How to insert data to MongoDB when using meteor

我在将 MongoDB 与 Meteor(使用 Webstorm 10)一起使用时遇到问题。

您知道执行 "Seed" 迁移的好方法吗?

我听说过 Mongo 插件,但是该插件的 Internet 文档很差,而且我无法理解如何使用 MongoExplorer。

有什么建议吗?

在应用程序启动时插入一些数据非常简单: or http://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