I’m pretty new to Meteor, so maybe I’m missing something here, but when updating a single document within a collection of 300 docs the callback of the update action takes more than 10 secs…this can’t be right.
However, when only fetching a single doc, the callback of the update action gets called almost immediately
So here’s what I did:
-
create collection
Movies = new Meteor.Collection("movies");
-
subscribe within the “waitOn” function of the route:
Meteor.subscribe('movies');
-
fetch all documents in a template helper
return Movies.find();
-
as I mentioned, when loading only a single document, the callback is executed really fast
return Movies.find({_id: '8KnQJAeDX6dWpbgJ4'});
-
update one document of the list
console.log('before update >>', moment().format('HH:mm:ss:SSS')); Movies.update({_id: '8KnQJAeDX6dWpbgJ4'}, {$set: {name: 'New name'}}, function(error, result){ console.log('after update >>', moment().format('HH:mm:ss:SSS')); });