-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: TypeScript
What problem are you facing?
Trying to upgrade to the v5 Mongo driver and am running into some unexpected behavior with the new `StrictFilter` and `StrictMatchKeysAndValues` util types for potentially undefined types
What driver and relevant dependency versions are you using?
`mongodb@5.5.0`
Steps to reproduce?
```
type TestNestedType = { value?:
}
const test:StrictMatchKeysAndValues<TestNestedType> =
{ 'value.nestedValue': false, // no type error }```
When a type is potentially undefined, these new strict types seem to return an `unknown` type
When the type is not optional, the types work as expected
```
type TestNestedType = { value:
}
const test:StrictMatchKeysAndValues<TestNestedType> =
{ 'value.nestedValue': false, // type error }```
- related to
-
NODE-4494 Filter / UpdateFilter do not infer the correct type of Record values
- Backlog