I\'m trying to display an alert to the user when data is added to the database. So I wrote (on the client side) :
Meteor.autosubscribe(function() {
ItemCol
You are observing a cursor for the client side database and that database may not finish syncing until after the page is done loading, so the behavior makes sense. You may want to look into explicitly subscribing to a collection as discussed in the answer to this question.
If your data had a created_at field then you could observe items created after the page loads.
ItemCollection.find({created_at : {$gt: some_current_time}}).observe({
added: function(item) {
// Alert code
}
});