Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a job to delete old event entries #12

Open
loreV opened this issue Apr 23, 2024 · 1 comment
Open

Add a job to delete old event entries #12

loreV opened this issue Apr 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@loreV
Copy link
Contributor

loreV commented Apr 23, 2024

The event job should have been configured so to delete the old entries every time the end_date is found in the past

@loreV loreV added the bug Something isn't working label Apr 23, 2024
@loreV
Copy link
Contributor Author

loreV commented Apr 23, 2024

Also, the existing collection data should be updated.
Only ~30 exists at current time

db.getCollection("ert.Event").find({})
   .projection({})
   .sort({_id:-1})
   .limit(1000).forEach((it) => {
       let dateFrom = new Date(it.date_from);
       let dateTo = new Date(it.date_to);
       
       db.getCollection("ert.Event").updateOne({_id: it._id}, 
            {$set: { 
                date_from: dateFrom, 
                date_to: dateTo
            }
        }
    )
   }
)

@loreV loreV self-assigned this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant