The MongoDB Node.js team is pleased to announce version 4.3.1 of the mongodb package!
Release Highlights
In this patch release, we address the limitation introduced in 4.3.0 with the dot notation Typescript improvements and recursive types.
Namely, this fix removes compilation errors for self-referential types.
Note that this fix still has the following limitations:
- type checking defaults to
any
after the first level of recursion for self-referential types
interface Node {
next: Node | null;
}
declare const collection: Collection<Node>;
// no error here even though `next` is of type `Node | null`
collection.find({
next: {
next: 'asdf'
}
});
- indirectly self-referential types are still not supported
interface A {
b: B;
}
interface B {
a: A;
}
declare const mutuallyRecursive: Collection<A>;
// this will throw an error because there is indirect recursion
// between types (A depends on B which depends on A and so on)
mutuallyRecursive.find({});
Bug Fixes
- NODE-3792: remove offensive language throughout the codebase (#3091) (8e2b0cc)
- NODE-3852,NODE-3854,NODE-3856: Misc typescript fixes for 4.3.1 (#3102) (dd5195a)
Documentation
- Reference: https://docs.mongodb.com/drivers/node
- API: https://mongodb.github.io/node-mongodb-native/4.3
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/main/HISTORY.md
We invite you to try the mongodb library immediately, and report any issues to the NODE project.