KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why this code shows "0"? Shouldn't it return "1"? Messages = new Meteor.Collection("messages"); if (Meteor.is_client) { Meteor.startup(function () { alert(Messages.find().count()); }); } if (Meteor.is_server) { Meteor.startup(function () { Messages.insert({text: "server says hello"}); }); } If I do the "Messages.find().count()" later, it returns 1.
Tags (comma-separated)
Save Edits
Cancel