Values = new Meteor.Collection("values");
if (Meteor.isServer) {
Meteor.startup(function () {
Meteor.setInterval(function() {
Values.insert({id: Math.random(), name: "value"});
console.log(Values.find({name: "value"}).id);
}, 1000);
});
}
I have that code and I'm trying to add a value to Values every second and find all the values I have and print them every second. However, it is not finding the values I add and is outputting:
I2043-14:21:56.895(0)? undefined