Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Upgrade mongodb from 4.10.0 to 4.11.0 #8309

Closed

Conversation

parseplatformorg
Copy link
Contributor

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.


  • The recommended version is 1 version ahead of your current version.
  • The recommended version was released 21 days ago, on 2022-10-19.
Release notes
Package name: mongodb
  • 4.11.0 - 2022-10-19

    The 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 Filter type but
    in 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).

    interface CircularSchema {
    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 the
    equivalent environment variable value in your script or application. Alternatively, you can create
    an AWS profile specifically for your MongoDB credentials and set the AWS_PROFILE environment
    variable to that profile name.

    External Contributions

    Many thanks to those who contributed to this release!

    • @ 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.

    Features

    Bug Fixes


    Documentation

    We invite you to try the mongodb library immediately, and report any issues to the NODE project.

  • 4.10.0 - 2022-09-19

    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 strikethroughs on these APIs. We encourage you to migrate to promises where possible:

    • Using async/await syntax can yield the best experience with promise usage.
    • Using Node.js' callbackify utility is one approach:
      • require('util').callbackify(() => collection.findOne())(callback)
    • Using .then syntax is another:
      • collection.findOne().then(res => callback(null, res), err => callback(err))
    • And lastly, for large codebases still intertwined with callbacks we have an alternative package prepared.

    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.

from mongodb GitHub release notes
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

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 10, 2022

Thanks for opening this pull request!

  • ❌ Please edit your post and use the provided template when creating a new pull request. This helps everyone to understand your post better and asks for essential information to quicker review the pull request.

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Base: 94.11% // Head: 86.82% // Decreases project coverage by -7.29% ⚠️

Coverage data is based on head (d96282a) compared to base (7cb266b).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8309      +/-   ##
==========================================
- Coverage   94.11%   86.82%   -7.30%     
==========================================
  Files         182      182              
  Lines       13785    13785              
==========================================
- Hits        12974    11969    -1005     
- Misses        811     1816    +1005     
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoCollection.js 4.76% <0.00%> (-92.86%) ⬇️
src/Adapters/Files/GridFSBucketAdapter.js 9.48% <0.00%> (-84.68%) ⬇️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 11.91% <0.00%> (-81.07%) ⬇️
src/Adapters/Cache/RedisCacheAdapter.js 12.28% <0.00%> (-75.44%) ⬇️
...rc/Adapters/Storage/Mongo/MongoSchemaCollection.js 35.48% <0.00%> (-62.37%) ⬇️
src/GraphQL/loaders/filesMutations.js 37.93% <0.00%> (-41.38%) ⬇️
src/Adapters/Storage/Mongo/MongoTransform.js 48.51% <0.00%> (-39.91%) ⬇️
src/Routers/SessionsRouter.js 65.71% <0.00%> (-25.72%) ⬇️
src/GraphQL/transformers/mutation.js 83.96% <0.00%> (-13.21%) ⬇️
src/Routers/AggregateRouter.js 88.00% <0.00%> (-12.00%) ⬇️
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mtrezza mtrezza changed the title [Snyk] Upgrade mongodb from 4.10.0 to 4.11.0 refactor: Upgrade mongodb from 4.10.0 to 4.11.0 Nov 10, 2022
@tomkretzschmar
Copy link

tomkretzschmar commented Feb 22, 2023

Are there any plans for this upgrade @mtrezza?

@mtrezza
Copy link
Member

mtrezza commented Feb 22, 2023

Closing for snyk to reopen due to package lock conflicts; if you don't want to wait for snyk you could open a PR with the upgrade.

@mtrezza mtrezza closed this Feb 22, 2023
@mtrezza mtrezza deleted the snyk-upgrade-8838cd7f8c7814cbe6fe38cc96ccb019 branch February 22, 2023 15:10
@tomkretzschmar
Copy link

tomkretzschmar commented Feb 23, 2023

Followup: #8438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants