Skip to content

DOCSP-32548: Breaking changes consolidation #777

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ Version 6.x Breaking Changes
- The ClientEncryption API returns promises instead of callbacks.
- The ``socks`` package, which enables SOCKS5 proxy support, is a
peer-optional dependency. You must install the package to enable
SOCKS5 in your application.
SOCKS5 in your application. To learn more, see :ref:`node-connect-socks`.
- If you start a session on a client, then pass that session to a
different client, the driver throws an error when you
perform any operations in the session.
- The ``includeResultMetadata`` option for compound operation methods is
``false`` by default.
``false`` by default. See the :ref:`Built-in Methods <node-compound-operations-builtin>`
section of the Compound Operations guide for more information.
- Raised the optional ``kerberos`` dependency minimum version to 2.0.1 and
removed support for version 1.x.
- Raised the optional ``zstd`` dependency minimum version to 1.1.0.
Expand Down
104 changes: 19 additions & 85 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,55 +48,11 @@ Learn what's new in:
What's New in 6.0
-----------------

.. important:: Breaking Changes in v6.0
.. warning:: Breaking Changes in v6.0

- Version 6.0 of the {+driver-short+} requires Node.js v16.20.1 or later.

- If you add ``mongodb-client-encryption`` as a dependency,
the major version number must match that of the {+driver-short+}. For example,
{+driver-short+} v6.x.x requires ``mongodb-client-encryption`` v6.x.x.

- Automatic Encryption methods are now in the {+driver-short+}. You must
import these methods from the driver instead of from
``mongodb-client-encryption``.

- Removed the ``ObjectId`` constructor that accepted a 12-character string.

- Modified ``abortTransaction()`` and ``commitTransaction()`` methods to return
``null`` instead of the raw command results.

- Removed connection option helpers that accepted values other than ``true``
or ``false`` as booleans. You must provide either ``true`` or ``false`` values in
the connection string or to the MongoClient constructor.

- Removed the ``Binary`` BSON type constructor that accepted a string.

- The ``Binary.write()`` method no longer accepts a string to write
to the binary BSON object.

- The ClientEncryption API returns promises instead of callbacks.

- The ``socks`` package, which enables SOCKS5 proxy support, is a
peer-optional dependency. To use ``socks`` functionality in your
application, you must install the package. To learn more, see
:ref:`node-connect-socks`.

- If you start a session on a client, then pass that session to a
different client, the driver throws an error when you
perform any operations in the session.

- The ``includeResultMetadata`` option for compound operation methods
is ``false`` by default. See the :ref:`Built-in
Methods <node-compound-operations-builtin>` section of the Compound
Operations guide for more information.
Comment on lines -88 to -91
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S: for certain entries, a page is linked in this note, but not in the breaking changes guide. Could you go through and make sure that additional information is linked in the breaking changes guide wherever they have been linked in these admonitions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this! I've added the links to installing the socks package (node-connect-socks) and information about compound operations (node-compound-operations-builtin).


- Raised the optional ``kerberos`` dependency minimum version to 2.0.1 and
removed support for version 1.x.

- Raised the optional ``zstd`` dependency minimum version to 1.1.0.

To learn more about the breaking changes included in this release, see the
`v6.0.0 Release Highlights <https://github.com/mongodb/node-mongodb-native/releases/tag/v6.0.0>`__.
This driver version introduces breaking changes. For a list of these changes, see
the :ref:`Version 6.x Breaking Changes section <node-breaking-changes-v6.x>` in the
Upgrade guide.

The {+driver-short+} v6.0 release includes the following features:

Expand Down Expand Up @@ -350,34 +306,11 @@ To learn more, see the `v5.1.0 Release Highlights
What's New in 5.0
-----------------

.. important:: Breaking Changes in v5.0

- Version 5.0 of the {+driver-short+} is not compatible with Node.js
v12 or earlier. If you want to use this version of the driver, You must
use Node.js v14.20.1 or greater.

- This release removes support for callbacks in favor of a promise-based API.
The following list provides some strategies for callback users to adopt this
version:
.. warning:: Breaking Changes in v5.0

- Migrate to the promise-based API (recommended)
- Use the promise-based API and ``util.callbackify``
- Add ``mongodb-legacy`` to continue using callbacks

For more information about these strategies, see
`Changes in the MongoDB Node.js Driver v5 <https://github.com/mongodb/node-mongodb-native/blob/main/etc/notes/CHANGES_5.0.0.md>`__.

- This release removes support for the ``Collection.insert()``,
``Collection.update()``, and ``Collection.remove()`` helper methods.
The following list provides instructions on how to replace the
functionality of the removed methods:

- Migrate from ``Collection.insert()`` to ``insertOne()`` or ``insertMany()``
- Migrate from ``Collection.update()`` to ``updateOne()`` or ``updateMany()``
- Migrate from ``Collection.remove()`` to ``deleteOne()`` or ``deleteMany()``

To view a full list of breaking changes introduced in this version, see the :ref:`Breaking
Changes section <node-breaking-changes-v5.x>` in the Upgrade guide.
This driver version introduces breaking changes. For a list of these changes, see
the :ref:`Version 5.x Breaking Changes section <node-breaking-changes-v5.x>` in the
Upgrade guide.

New features of the 5.0 {+driver-short+} release include:

Expand Down Expand Up @@ -747,13 +680,21 @@ New features of the 4.1 Node.js driver release include:
What's New in 4.0
-----------------

.. important::
.. warning:: Breaking Changes in v4.0

In this release of the driver, the deprecated ``collection.count()`` method was inadvertently changed to
behave like ``collection.countDocuments()``. This behavior is corrected in :ref:`version 4.4 <version-4.4>`.
This driver version introduces breaking changes. For a list of these changes, see
the :ref:`Version 4.x Breaking Changes section <node-breaking-changes-v4.x>` in
the Upgrade guide.

New features of the 4.0 Node.js driver release include:

.. important::

In this release of the driver, the deprecated ``collection.count()`` method was
inadvertently changed to behave like ``collection.countDocuments()``. This behavior
is corrected in :ref:`version 4.4 <version-4.4>`.


TypeScript
~~~~~~~~~~

Expand Down Expand Up @@ -1044,13 +985,6 @@ The ``instrument()`` method is now removed. Use command monitoring instead.
See our guide on :doc:`command monitoring </fundamentals/monitoring/command-monitoring>`
for more information.


Detailed List
~~~~~~~~~~~~~

To view a full list of breaking changes introduced in this version, see the :ref:`Breaking
Changes section <node-breaking-changes-v4.x>` in the Upgrade guide.

.. _version-3.7:

What's New in 3.7
Expand Down