In my Node application I use the mongoose module. I found out that after
model_name.create({...})
object is not created immediately but with some delay (buffer?). How can I force to save this new object in this particular moment?
In my Node application I use the mongoose module. I found out that after
model_name.create({...})
object is not created immediately but with some delay (buffer?). How can I force to save this new object in this particular moment?
Copyright © 2021 Jogjafile Inc.
Mongoose inserts the value inmediatly.
The problem is that you are not using it´s callback. Try to code this way:
Anyway, there you have some documentation:
the mongoose docs about callbacks
Some docs about Async methods:
Hope it will solve you problem