-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
updateOne returns a null upsertedId (but doc and TS type do not allow that).
What driver and relevant dependency versions are you using?
mongodb@4.4.1
Steps to reproduce?
Just look at the code: https://github.com/mongodb/node-mongodb-native/blob/5132bc9d8ba816b0d98e1fceb6dfc96be0beb1da/src/operations/update.ts#L174
Btw you should refactor your code, you should not have been able to return a null value for a non nullable field. You should remove Document from callback arg union type or at least check that the value you give to the callback match UpdateResult type.