Sunday 25 August 2019

JavaScript Singleton?

So I've been working on a small project recently. I'm fairly new to node.So, what I'm looking for is:client sends object to back endback end express server adds it to 'master' listat the end of the day, somebody can generate a report, wiping the days liststarts over the next dayI was thinking that I could use some kind of database, but I don't really like the idea of wiping the database every time somebody wants to make a report. Also , I thought that I might be able to do some simple csv file io, but I think that might be a little strange. Preferably, I'd like some sort of 'singleton' that will take any new objects and add them to the list. I'm not especially concerned about the performance issues this might have, but I'd love to hear ideas on that.Edit: Maybe I could just add them to the database (I want to use mongoose/mongodb) and when I want to generate a report, query the specific day? This might work, but I dont really like the idea of persisting essentially a bunch of useless data.

Submitted August 25, 2019 at 07:13AM by gungunthegun

No comments:

Post a Comment