dependabot npm(deps): bump mongodb from 4.2.2 to 4.3.0
Bumps mongodb from 4.2.2 to 4.3.0.
Release notes
Sourced from mongodb's releases.
v4.3.0
The MongoDB Node.js team is pleased to announce version 4.3.0 of the mongodb package!
Release Highlights
This release includes SOCKS5 support and a couple of other important features and bug fixes that we hope will improve your experience with the node driver.
The SOCKS5 options can be configured via the
proxyHost,proxyPort,proxyPasswordandproxyUsernameoptions in the connection string passed to theMongoClientinstance. Big thanks to@addaleaxfor helping with this feature!The other notable features address performance and TypeScript as detailed below.
Performance
The original release of the 4.x driver relied on a new version of the BSON library that enables UTF-8 validation by default, resulting in noticeable performance degradation over the 3.x driver when processing over string data. This release introduces an option to opt out of this validation by specifying
enableUtf8Validation: falseat the client, database, collection, or individual operation level.For example:
// disable UTF-8 validation globally on the MongoDB client const client = new MongoClient('mongodb://localhost:27017', { enableUtf8Validation: false }); // disable UTF-8 validation for a particular operation const client = new MongoClient('mongodb://localhost:27017'); const db = client.db('database name'); const collection = db.collection('collection name'); await collection.find({ name: 'John Doe'}, { enableUtf8Validation: false });TypeScript
Type inference for nested documents
Thanks to an amazing contribution from
@avalywe now have support for key auto-completion and type hinting on nested documents! MongoDB permits using dotted keys to reference nested keys or specific array indexes within your documents as a shorthand for getting at keys beneath the top layer. Typescript's Template Literal types allow us to take the interface defined on a collection and calculate at compile time the nested keys and indexes available.For example:
interface Human { name: string; age: number; } interface Pet { name: string bestFriend: Human } const pets = client.db().collection<Pet>('pets'); await pets.findOne({ 'bestFriend.age': 'young!' }) // typescript error!
... (truncated)
Commits
-
e58fbf2chore(release): 4.3.0 -
00be68frefactor(NODE-3717): Test reorg part 7 (#3093) -
d5ff074chore(gridfs): improve error message when overrunning file length (#3094) -
b701d5drefactor(NODE-3717): test reorganization part 6 (#3090) -
7bb9e37fix(gridfs): makeGridFSBucketWriteStream.prototype.end()returnthisfor... -
54f2352refactor(NODE-3717): reorganize tests pt5 -
451627afeat(NODE-3633): add Socks5 support (#3041) -
76fff97feat(NODE-3589): support dot-notation attributes in Filter (#2972) -
91a67e0feat(NODE-3793): Remove offensive language from code and tests (#3082) -
8a3bab7test(NODE-3713): skip/fix failing evergreen tests (#3069) - Additional commits viewable in compare view