[Snyk] Upgrade mongodb from 4.2.2 to 4.7.0 #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade mongodb from 4.2.2 to 4.7.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: mongodb
The MongoDB Node.js team is pleased to announce version 4.7.0 of the mongodb package! Happy MongoDB World Day!
Release Highlights
Support for ZSTD Compression
zstd compression is now supported by the NodeJS driver. To enable zstd compression, add it as a dependency in your project:
npm install –save @ mongodb-js/zstd
. The add the option to your URI options:mongodb://host:port/db?compressors=zstd
.Improved Connection Storm Avoidance
The Node driver has improved connection storm avoidance by limiting the number of connections that the driver will attempt to open to each server at a time. The number of concurrent connection attempts is set to 2 by default, but can be configured with a new MongoClient argument,
maxConnecting
. The following code example creates a new MongoClient that configuresmaxConnecting
to 5.Expanded Change Stream Events
The collection.watch function now supports a new option,
showExpandedEvents
. WhenshowExpandedEvents
is enabled, change streams will report the following events on servers 6.0 and later:createIndexes
dropIndexes
modify
create
shardCollection
On servers 6.1.0 and later,
showExpandedEvents
will also show change stream events for the following commands:reshardCollection
refineCollectionShardKey
As an example, the following code creates a change stream that has expanded events enabled on a collection:
await client.connect();
const collection = client.db('example-db').collection('example-collection');
const changeStream = collection.watch([], { showExpandedEvents: true });
Change Stream Support of Pre/Post Images
Change streams now support pre and post images for update events. To enable pre and post images, the collection must be created with the
changeStreamPreAndPostImages
option enabled:Pre and post images can then be enabled on the change stream when the change stream is created:
See the documentation on pre and post images for more information: https://www.mongodb.com/docs/v6.0/changeStreams/#change-streams-with-document-pre--and-post-images.
Improved Performance in Serverless Environments
The driver now only processes the most recent server monitoring event if multiple heartbeat events are recorded in sequence before any can be processed. In serverless environments, this results in increased performance when a function is invoked after a period of inactivity as well as lower resource consumption.
Estimated Document Count uses the Count command
The 5.0 server compatible release unintentionally broke the
estimatedDocumentCount
command on views by changing the implementation from thecount
command toaggregate
and acollStats
stage. This release fixes estimatedDocumentCount on views by reverting the implementation to usecount
.Due to an oversight, the count command was omitted from the Stable API in server versions 5.0.0 - 5.0.8 and 5.1.0 - 5.3.1, so users of the Stable API with estimatedDocumentCount are recommended to upgrade their MongoDB clusters to 5.0.9 or 5.3.2 (if on Atlas) or set apiStrict: false when constructing their MongoClients.
MongoClient.connect is now optional
If an operation is run before MongoClient.connect is called by the client, the driver will now automatically connect along with that first operation. This makes the repl experience much more streamlined, going right from client construction to your first insert or find. However, MongoClient.connect can still be called manually and remains useful for learning about misconfiguration (auth, server not started, connection string correctness) early in your application's startup.
Support for Clustered Collections
Clustered Collections can now be created using the
createCollection
method in the Node driver:More information about clustered indexes can be found on the official documentation page. https://www.mongodb.com/docs/upcoming/core/clustered-collections/
Automatic Encryption Shared Library
To enable the driver to use the new Automatic Encryption Shared Library instead of using mongocryptd, pass the location of the library in the auto-encryption extra options to the
MongoClient
. Example:autoEncryption: {
keyVaultNamespace: 'encryption.__keyVault',
kmsProviders: {
local: { key: 'localKey' }
},
extraOptions: {
cryptSharedLibPath: "/path/to/mongo_crypt_v1.dylib",
},
encryptedFieldsMap: {
"default.secretCollection": {
[
{
keyId: '_id',
path: 'ssn',
bsonType: 'string',
queries: { queryType: 'equality' }
}
]
},
},
},
})
Queryable Encryption Preview
Queryable Encryption is a beta feature that enables you to encrypt data in your application before you send it over the network to MongoDB while still maintaining the ability to query the encrypted data. With Queryable Encryption enabled, no MongoDB-managed service has access to your data in an unencrypted form.
Checkout the documentation: https://www.mongodb.com/docs/upcoming/core/queryable-encryption/queryable-encryption/
Features:
Bug Fixes
Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
Read more
The MongoDB Node.js team is pleased to announce version v4.6.0-alpha.0 of the mongodb package!
Release Highlights
This release is for internal testing - NOT intended for use production.
Features
Bug Fixes
Documentation
Read more
Read more
Read more
Read more
Read more
Read more
Commit messages
Package name: mongodb
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:![](https://camo.githubusercontent.com/4e652201de6534b814f3b897c00eb5b1f70b13bec8cd200fecff858bb632784e/68747470733a2f2f6170692e7365676d656e742e696f2f76312f706978656c2f747261636b3f646174613d65794a33636d6c305a55746c65534936496e4a79576d785a634564485932527954485a7362306c596430645563566734576b4652546e4e434f5545774969776959573576626e6c746233567a535751694f694a6c596d4d324d54466d5a53316c5a54526c4c5452684d4759744f44597959793030597a6b3459575a6b597a56695a6d55694c434a6c646d567564434936496c425349485a705a58646c5a434973496e42796233426c636e52705a584d694f6e736963484a4a5a434936496d5669597a59784d575a6c4c57566c4e4755744e4745775a6930344e6a4a6a4c54526a4f5468685a6d526a4e574a6d5a534a3966513d3d)
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs