[Snyk] Upgrade mongodb from 4.10.0 to 4.11.0 #52
  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.10.0 to 4.11.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
- 
        4.11.0 - 2022-10-19
 interface CircularSchema { - @ ermik provided an extremely large schema to test compilation with, which made testing our new recursive schema support possible with large schemas straightforward.
- @ noahsilas for documentation improvements in change streams and fixing our Typescript types for read preferences.
- @ zendagin for adding Typescript support for hashed indexes.
- @ biniona-mongodb for fixing our parsing of TLS options.
- @ LinusU for removing support for server versions lower than our minimum supported server version and improving error messages for unacknowledged writes with hints.
 - NODE-3651: add hashed index type (#3432) (f6b56a1)
- NODE-3875: support recursive schema types (#3433) (26bce4a)
- NODE-4503: throw original error when server attaches NoWritesPerformed label (#3441) (a7dab96)
- NODE-4650: handle handshake errors with SDAM (#3426) (cbe7533)
- NODE-4721: add aws-sdk as optional dependency (#3446) (b879cb5)
 - NODE-3712,NODE-4546: electionId should be ordered before setVersion (#3174) (ca51fec)
- NODE-3921: error on invalid TLS option combinations (#3405) (1a550df)
- NODE-4186: accept ReadPreferenceLike in TransactionOptions type (#3425) (dc62bcb)
- NODE-4475: make interrupted message more specific (#3437) (5f37cb6)
- NODE-4608: prevent parallel monitor checks (#3404) (78bcfe4)
- NODE-4647: improve error message (#3409) (0d3c02e)
- NODE-4649: use SDAM handling for errors from min pool size population (#3424) (ef3b55d)
 
 - Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/4.11
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/main/HISTORY.md
 
- 
        4.10.0 - 2022-09-19
 - Using 
- Using Node.js' callbackify utility is one approach:
 
- Using .then syntax is another:
 
- And lastly, for large codebases still intertwined with callbacks we have an alternative package prepared.
 - https://github.com/mongodb-js/nodejs-mongodb-legacy#readme
 - NODE-4385: add cmap pool pausing functionality (#3321) (335ee55)
- NODE-4484: add experimental support for disambiguatedPaths in change stream documents (#3365) (846365a)
- NODE-4519: deprecate promiseLibrary and PromiseProvider (#3403) (5c322b6)
- NODE-4547: mark all callback APIs as deprecated (#3388) (a983f14)
- NODE-4634: add support for bulk FindOperators.hint() (#3408) (8758890)
 - NODE-3144: pool clear event ordering and retryability tests (#3407) (bdc0d67)
- NODE-4557: randomize servers when there are only 2 eligible servers (#3390) (ddcfa49)
- NODE-4583: revert nested union type support (#3383) (7f94f0a)
- NODE-4591: only set loadBalanced on handshake when explicitly set (#3386) (57e9f2d)
- NODE-4621: ipv6 address handling in HostAddress (#3410) (5eb3978)
- NODE-4639: allow PromiseProvider to be null (#3412) (d29b3d9)
 - Reference: https://docs.mongodb.com/drivers/node/current/
- API: https://mongodb.github.io/node-mongodb-native/4.10
- Changelog: https://github.com/mongodb/node-mongodb-native/blob/main/HISTORY.md
 
from mongodb GitHub release notesThe MongoDB Node.js team is pleased to announce version 4.11.0 of the mongodb package!
Release Highlights
Recursive Schema Support
Version 4.3.0 of the Node driver added Typescript support for dot notation into our
Filtertype butin the process it broke support for recursive schemas. In 4.11.0, we now support recursive schemas and
provide type safety on dot notation queries up to a depth of 9. Beyond a depth of 9, code still compiles
but is no longer type checked (it falls back to a type of
any).name: string;
nestedSchema: CircularSchema;
}
// we have a collection of type Collection<CircularSchema>
// below a depth of 9, type checking is enforced
collection.findOne({ 'nestedSchema.nestedSchema.nestedSchema.name': 25 }) // compilation error - name must be a string
// at a depth greater than 9, code compiles but is not type checked (11 deep)
collection.findOne({
'nestedSchema.nestedSchema.nestedSchema.nestedSchema.nestedSchema.nestedSchema.nestedSchema.nestedSchema.nestedSchema.nestedSchema.name': 25
}) // NO compilation error
Note that our depth limit is a product of Typescript's recursive type limitations.
AWS Authentication
If the optional aws-sdk dependency is installed, the driver will now use the SDK to get credentials
from the environment. Because of this, if you have a shared AWS credentials or config file, then
those credentials will be used by default if AWS auth environment variables are not set. To override this
behavior, set
AWS_SHARED_CREDENTIALS_FILE=""in your shell or set theequivalent environment variable value in your script or application. Alternatively, you can create
an AWS profile specifically for your MongoDB credentials and set the
AWS_PROFILEenvironmentvariable to that profile name.
External Contributions
Many thanks to those who contributed to this release!
Features
Bug Fixes
Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
The MongoDB Node.js team is pleased to announce version 4.10.0 of the mongodb package!
Release Highlights
Callback Deprecation
Looking to improve our API's consistency and handling of errors we are planning to remove callback support in the next major release of the driver. Today marks the notice of their removal. Migrating to a promise only API allows us to offer uniform error handling and better native support for automatic promise construction. In this release you will notice deprecation warnings in doc comments for all our callback overloads and if you are working in VSCode you should notice
strikethroughson these APIs. We encourage you to migrate to promises where possible:async/awaitsyntax can yield the best experience with promise usage.require('util').callbackify(() => collection.findOne())(callback)collection.findOne().then(res => callback(null, res), err => callback(err))MongoDB-Legacy Callback Support
While the 4.10.0 version only deprecates our support of callbacks, there will be a major version that removes the support altogether. In order to keep using callbacks after v5 is released, we recommend migrating your driver version to mongodb-legacy (github link). This package wraps every single async API our driver offers and is designed to provide the exact behavior of the MongoDB 4.10.0 release (both callbacks and promises are supported). Any new features added to MongoDB will be automatically inherited but will only support promises. This package is fully tested against our current suite and adoption should be confined to changing an import
require('mongodb')->require('mongodb-legacy'). If this package is useful to you and your use case we encourage you to adopt it before v5 to ensure it continues to work as expected.Read more about it on the package's readme here:
Features
Bug Fixes
Documentation
We invite you to try the mongodb library immediately, and report any issues to the NODE project.
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:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs