mongoose pre save hook #9866
Unanswered
vardges-musheghyan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I am implementing a booking application and I need to check the start date of the appointment and if it is today then I need to split my appointments into two differents appointments one of which is e.g
today is 2020-01-26;
start_date is 2020-01-26
end_date is 2020-01-29
then I will need to have one two appointments one of which is
appointment 1 - start_date = 2020-01-26, end_date = 2020-01-26;
appointment2 - start_date = 2020-01-27, end_date = 2020-01-29;
I am trying to do it in pre save hook,
can someone please explain me how this could be implemented in mongoose world
Beta Was this translation helpful? Give feedback.
All reactions