Closed maxsimych closed 3 years ago
Here we go again :D Thanks for the report.
This should be covered by testing but I think I'll have to include a few more versions.
Just to keep you updated. With a newer mongoose version this behaviour is indeed happening over all node versions. I'll need to find out what causes that odd behaviour, might take a while.
Else, if you would like to help out, you can try to pin down the specific minor mongoose version.
Only thing I can say is that it is somewhere between 5.6
and 5.10
.
@vinerich hello, any news?)
@maxsimych Thanks for bumping! It must've slipt through.
Somewhere along the versions 5.9 to 5.10 several changes where introduced:
next()
, simply calling return while leave a non-returning promise.{ nModified: 1, ... }
to { nModified: 0, upserted: [docs], ... }
So I changed the nModified
check to include the new upserted
property and am calling next()
to return.
Will write PRs and then you should be good to go.
@codepunkt I know time is spare. Just want to bump the PR if you got the time.
@vinerich you should have contributor permissions - atleast I sent out an invite 😉
@codepunkt I should indeed have, if I didn't forgot it about the new years. Invitation is expired, can you resend it? I'll accept this time :D Thanks.
If nothing was found with updateOne, (same for update and updateMany) query just hangs without response.
When I turn off the plugin, I get correct result from the query:
{ n: 0, nModified: 0, ok: 1 }
versions: node: 14.11.0 mongodb: 3.6.2 mongoose: 5.10.6 mongoose-patch-history: the version from github master
config: