Make create()
wait for all documents to finish inserting or error out before throwing an error if ordered = false
#4628
Labels
Milestone
Hello,
I'm facing a very weird problem which unfortunately happens randomly, so I can put the code that actually reproduces it.
Ideally is something like this:
The model
The operations:
So the problem is that sometimes, the elements do not get removed, without any error being thrown.
It is interesting to note that if i put a setTimeout (2 seconds is enough) between the create and the remove, the elements get removed.
Also, it looks like that if the create doesn't throw an error, the problem never occurs. This is the reason why I put a duplicate _id in the elements.
Any idea? I'm using mongoose 4.5.5
Thanks
The text was updated successfully, but these errors were encountered: