Answer the question
In order to leave comments, you need to log in
How to wait for save to database?
Hello.
How to make the code continue to work only after the data has been saved to the database?
await Bet.findByIdAndUpdate(bet.id, {
player2: session.user
})
...чтобы этот код не выполнялся пока findByIdAndUpdate всё не сохранит?
Answer the question
In order to leave comments, you need to log in
In your example it will. It is obvious that you provided little information.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question