0

I am writing a Cube.js (Website) data source, so that I can visualize the events in Cubism.js.

However, I only want to retain a certain number of events and discard the rest (like a circular buffer). I run my system between 9am to 5pm and can afford to do this clean up at the end of the day.

There is no documentation on what happens to the events and how long they are retained for, so I am not sure where to start from.

If anyone has any pointers or ideas on how to achieve this, I'll be thankful.

smhx
  • 2,246
  • 18
  • 22

1 Answers1

0

What about if you delete events collection inside mongodb, what i'm done is :

use your_db_name;    
db.getCollectionNames().forEach(function(c){  
   if(!c.match("^(cube_compute_events|cube_compute_metrics|cube_request_events|cube_request_metri cs|random_events|random_metrics|system.indexes)")){
      db.getCollection(c).drop();
   }
});
Agung Prasetyo
  • 4,353
  • 5
  • 29
  • 37