@@ -18,7 +18,7 @@ The following is a detailed collection of the changes in the major v5 release of
18
18
19
19
### Dot Notation Typescript Support Removed By Default
20
20
21
- ** NOTE** This is a ** Typescript compile-time only** change. Dot notation in filters sent to MongoDB still work the same.
21
+ ** NOTE** This is a ** Typescript compile-time only** change. Dot notation in filters sent to MongoDB will still work the same.
22
22
23
23
Version 4.3.0 introduced Typescript support for dot notation in filter predicates. For example:
24
24
@@ -34,15 +34,17 @@ declare const collection: Collection<Schema>;
34
34
collection .find ({ ' user.name' : 4 })
35
35
```
36
36
37
- This change caused many problems for users, including slow compilation times and compile errors for
38
- valid dot notation queries.
37
+ This change caused a number of problems for users, including slow compilation times and compile errors for
38
+ valid dot notation queries. While we have tried to mitigate this issue as much as possible
39
+ in v4, ultimately we do not believe that this feature is fully production ready for all use cases.
39
40
40
41
Driver 5.0 removes type checking on filter predicates. The preceding example will compile with
41
42
driver v5.
42
43
43
44
#### Dot Notation Helper Types Exported
44
45
45
- Although we removed support for type checking on dot notation filters by default, we now export these types.
46
+ Although we removed support for type checking on dot notation filters by default, we have preserved the
47
+ corresponding types in an experimental capacity.
46
48
These helper types can be used for type checking. We export the ` StrictUpdateFilter ` and the ` StrictFilter `
47
49
types for type safety in updates and finds.
48
50
@@ -61,7 +63,7 @@ const filterPredicate: StrictFilter<Schema> = { 'user.name': 4 };
61
63
collection .find (filterPredicate );
62
64
```
63
65
64
- ** NOTE** These types are also now marked experimental and can be changed at any time .
66
+ ** NOTE** As an experimental feature, these types can change at any time and are not recommended for production settings .
65
67
66
68
### ` Collection.mapReduce() ` helper removed
67
69
0 commit comments