Details
-
Bug
-
Status: Closed
-
Unknown
-
Resolution: Duplicate
-
4.8.0
-
None
-
Not Needed
Description
What problem are you facing?
Currently, querying / updating deeply nested fields works perfectly, as long as those fields aren't objects themselves.
When they are objects:
- Querying ignores type validation
- Updating errors
What driver and relevant dependency versions are you using?
4.8.0
Steps to reproduce?
Create a type:
type User = {
|
pet: {
|
name: {
|
first: string;
|
last: string;
|
}
|
}
|
}
|
|
// This works when it shouldn't
|
const query: mongodb.Filter<User> = { "pet.name": { first: 1 } }; |
|
// This doesn't work when it should
|
const update: mongodb.UpdateFilter<User> = { "pet.name": { first: "a", last: "b" } } |