0

I'm thinking about building a log follower similar to the Console on OSX.

Log entries get inserted in the database on the server and are displayed in the client browser.

Meteor seems well-suited for this with its ability to follow a cursor but, my question is:

Is there way to age out older data in the client-side Mongo/Collection and the DOM? (While keeping it all in the server-side Mongo?) Otherwise, the longer you run the more memory you'll use and it's just not sustainable.

1 Answer 1

2

An easy way to do this is just to publish the N most recent logs. For example:

Meteor.publish('recentLogs', function () {
  return Logs.find({owner: this.userId}, {sort: {createdAt: -1}, limit: 100});
});

In this example, the client would only have the 100 most recent logs that he or she owned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.