How to display one data only one time, from database

Hello, I am currently working on a project, where I have content coming from the database that needs to change several times a day.

What I need to do:

  • To explain a little better, morning, noon and evening, different quotes from the database need to be displayed. For example one in the morning, then a brand new one in the afternoon and another one in the evening.

  • I don’t want the same quotes to come back the next day

  • I’m doing this on a dynamic page, so I’d like the content to start displaying when the user first wants to start this experience. I’m thinking of doing this with a button the first time the user arrives on their custom page.

My question:

Is there a simple way to do this rolling system of content that changes multiple times a day and continues again the next day?

What I did :

I haven’t found a better solution yet, that’s why I would like to know how you would have done it.

Now, here is how I was going to do it:

I got a database with 3 collections :

  • contacts (there is all data from users, name, surname, city … )
    -Multimedia (there is all content i will display : quotes, audios etc)
  • Multimedia_distributed_to_contacts ( there is a ref to “id contact” and “id media” (for example the id of a quote) and a time stamp for knowing when the content was pushed, so after 1 month i can send them this content again)

So I was going to do it like this, even like this I’m not sure of how I’m going to doing it.

On the code side, I currently have objects containing all the media I need (audio/quotes/videos) and I plan to map them.

And I made some conditions that work depending on the time of day.

So I need to find a solution to vary the content I put.

If you have any ideas, solutions, I am VERY interested.

I’ll probably continue to document my progress below this post even if I don’t get a response, I can also send my current code if needed.

Thanks !