How to stop MongoDB from reloading data every time I refresh a page?
问题 Basically I am practicing NodeJs/MongoDB by making a simple blog app. I am using the .find() method to final all the saved blogs on the db , and then running it through a loop to post it on the main page. That method is called every time the page is refreshed, so how do I stop it from being called to avoid automatic reposts? exports.getBlogEntries = function() { Entry.find(function(err, entries) { if (!err){ for(i = 1; i < entries.length; i++ ) { list.push(entries[i]); } } }); return list; };