-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
When using dot notation on a find or update filter, if your string includes a variable, the type will not match as the full string is interpreted as a regular string and not a constant one, thus requiring the `as const` type assertion. This also happens if your variable is strictly typed, that means that it's not typed as `string` but the values it can actually have are explicitly typed. Here's an example:
What driver and relevant dependency versions are you using?
4.11.0
Steps to reproduce?
- Have a collection's type include an object with explicitly typed properties
- Try to modify one of those properties by using dot notation on an updateOne operation
- Change one of the properties and use a variable to type it instead
- Notice the type error
- duplicates
-
NODE-4765 UpdateFilter typings fail for typings including `number`
- Closed