Skip to content

refactor: upgrade mongodb from 4.5.0 to 4.6.0 #8022

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

Merged
merged 2 commits into from
Jun 4, 2022

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jun 2, 2022

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade mongodb from 4.5.0 to 4.6.0.

merge advice
ℹ️ 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 2 versions ahead of your current version.
  • The recommended version was released 22 days ago, on 2022-05-11.
Release notes
Package name: mongodb
  • 4.6.0 - 2022-05-11

    The MongoDB Node.js team is pleased to announce version 4.6.0 of the mongodb package!

    Release Highlights

    TypeScript: ChangeStreamDocument

    Our change stream document type and watch API have undergone some improvements! You can now define your own custom type for the top level document returned in a 'change' event. This is very useful when using a pipeline that significantly changes the shape of the change document (ex. $replaceRoot, $project operators). Additionally, we've improved the type information of the default change stream document to default to union of the possible events from MongoDB. This works well with typescript's ability to narrow a Discriminated Union based on the operationType key in the default change stream document.

    Prior to this change the ChangeStreamDocument inaccurately reflected the runtime shape of the change document. Now, using the union, we correctly indicate that some properties do not exist at all on certain events (as opposed to being optional). With this typescript fix we have added the properties to for rename events, as well as lsid, txnNumber, and clusterTime if the change is from within a transaction.

    NOTE: Updating to this version may require fixing typescript issues. Those looking to adopt this version but defer any type corrections can use the watch API like so: .watch<any, X>(). Where X controls the type of the change document for your use case.

    Check out the examples and documentation here.

    Performance: Consider Server Load During Server Selection

    Operations will now be directed towards servers that have fewer in progress operations, distributing the load more evenly across servers.

    Note

    This release includes some experimental features that are not yet ready for use. As a reminder, anything marked experimental is not a part of the official driver API and is subject to change without notice.

    Features

    Bug Fixes

    Documentation

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

  • 4.6.0-alpha.0 - 2022-05-04

    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

  • 4.5.0 - 2022-04-04

    The MongoDB Node.js team is pleased to announce version 4.5.0 of the mongodb package!

    Release Highlights

    This release includes a number of enhancements noted below.

    comment option support

    The comment option is now widely available: by setting a comment on an operation you can trace its value in database logs for more insights.

    collection.insertOne(
      { name: 'spot' },
      { comment: { started: new Date() } }
    )

    An example of a log line, trimmed for brevity. We can see the timestamp of the log and the time created on our client application differ.

    {
      "t": { "$date": "2022-04-04T16:08:56.079-04:00" },
      "attr": {
        "commandArgs": {
          "documents": [ { "_id": "...", "name": "spot" } ],
          "comment": { "started": { "$date": "2022-04-04T20:08:56.072Z" } } }
      }
    }

    Socket timeout fixes for FaaS environments

    This release includes a fix for serverless environments where transient serverHeartBeatFailure events that could be corrected to serverHeartBeatSucceeded events in the next tick of the event loop were nonetheless handled as an actual issue with the client's connection and caused unnecessary resource clean up routines.

    It turns out that since Node.js handles timeout events first in the event loop, socket timeouts expire while the FaaS environment is dormant and the timeout handler code is the first thing that runs upon function wake prior to checking for any data from the server. Delaying the timeout handling until after the data reading phase avoids the sleep-induced timeout error in the cases where the connection is still healthy.

    TS fixes for 4.7

    Typescript 4.7 may not be out yet but in preparation for its release we've fixed issues compiling against that version. The main new obstacle was defaulting generic arguments that require that the constraining condition enforce similarity with the defaulted type. You may notice that our change stream watch<T extends Document = Document>() methods now requires that T extends Document, a requirement that already had to be met by the underlying ChangeStreamDocument type.

    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

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title [Snyk] Upgrade mongodb from 4.5.0 to 4.6.0 refactor: upgrade mongodb from 4.5.0 to 4.6.0 Jun 2, 2022
@parse-github-assistant
Copy link

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 Jun 2, 2022

Codecov Report

Merging #8022 (f4b06c9) into alpha (9e50696) will decrease coverage by 0.03%.
The diff coverage is n/a.

❗ Current head f4b06c9 differs from pull request most recent head 6322d62. Consider uploading reports for the commit 6322d62 to get more accurate results

@@            Coverage Diff             @@
##            alpha    #8022      +/-   ##
==========================================
- Coverage   94.13%   94.09%   -0.04%     
==========================================
  Files         182      182              
  Lines       13634    13634              
==========================================
- Hits        12834    12829       -5     
- Misses        800      805       +5     
Impacted Files Coverage Δ
src/Routers/AggregateRouter.js 92.00% <0.00%> (-8.00%) ⬇️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.94% <0.00%> (-0.22%) ⬇️
src/Adapters/Storage/Mongo/MongoTransform.js 87.94% <0.00%> (-0.16%) ⬇️
src/Adapters/Files/GridFSBucketAdapter.js 80.32% <0.00%> (+0.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e50696...6322d62. Read the comment docs.

@mtrezza mtrezza merged commit 468e987 into alpha Jun 4, 2022
@mtrezza mtrezza deleted the snyk-upgrade-628e5396e404d29d6ca4dcd8d21161cc branch June 4, 2022 00:41
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-alpha.15

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jun 5, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Jun 17, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants