You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It actually seems to be resolved by adding an empty object to options, not necessarily options.defaults. Very odd, definitely worth investigating further.
Code Editor: VSCode latest
Typescript version: 4.9.5
Code:
The schema defines
firstName
andlastName
as required fields, but in the argumentdoc
in insertOne whose fields are optional:This can be temporarily fixed by providing an empty object for the
defaults
option in the schema:It's better to somehow fix this in the types, perhaps by removing
Partial
fromDocumentForInsertWithoutDefaults
, which would result in this:Could this change break any logic? All tests are passing.
The text was updated successfully, but these errors were encountered: