これが私のコードです。https://github.com/StudioMockingbird/SH_meteor
コレクションに自分のデータを挿入しようとしているリーダーボードの例です。
私のデータは lib/book.js にあり、オブジェクト (var myBook) として定義されています。
挿入に使用するコードは Leaderboard.js にあります -
Pages = new Meteor.Collection("pages");
if (Meteor.isServer) {
Meteor.startup(function () {
if(Pages.find().count() === 0){
var pages = JSON.parse(myBook.stories);
for (page in pages) {
Pages.insert(pages[page]);
}
}
});
}
コードを実行しようとすると、
Running on: http://localhost:3000/
Exited with code: 1
Exited with code: 1
Exited with code: 1
Your application is crashing. Waiting for file change.
私は何を間違っていますか?私は流星にまったく新しいです。