Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用流星作为我的项目的前端,我使用 node.js 和 mongodb 作为后端。我不知道在流星中读取值。请帮我。
试试这个代码:
Pages = new Meteor.Collection("pages"); Meteor.startup(function () { if(Pages.find().count() === 0){ var pages = JSON.parse(MY_JSON_LIST); for (page in pages) { Pages.insert(pages[page]); } } });