1
查询收藏我的model.js这样定义的集合:使用的setTimeout在流星
People = new Meteor.Collection("people");
下面是main.js代码:
function test2(){
console.log(JSON.stringify(People.find().fetch()));
setTimeout(test2,5000)
}
if (Meteor.isServer) {
if(People.find().fetch().length === 0){
var tom = {name:"Tom",age:18};
People.insert(tom);
}
Meteor.startup(function() {
test2();
});
}
下面是我得到的错误:
我想流星的收集AUT执行一些CRUD按设定的时间间隔进行。所以我使用setTimeOut
,但它似乎很难。
有关我在做什么错的任何想法?
而我尝试使用Noe.js的Events类,但错误是相同的:
–