Skip to content

Commit 7d7896b

Browse files
author
Chris Cho
authored
consolidate breaking changes for 5.0 (#496)
* consolidate breaking changes for 5.0
1 parent 9b92e1d commit 7d7896b

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

source/whats-new.txt

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,39 @@ Learn what's new in:
3333
What's New in 5.0
3434
-----------------
3535

36-
.. important:: Version 5.0 Not Compatible with Node.js Version 12
36+
.. important:: Breaking Changes in v5.0
3737

38-
Version 5.0 of the {+driver-short+} is not compatible with Node.js
39-
version 12 or earlier. If you wish to upgrade, you need to use
40-
Node.js version 14.20.1 or greater.
38+
- Version 5.0 of the {+driver-short+} is not compatible with Node.js
39+
v12 or earlier. If you want to use this version of the driver, You must
40+
use Node.js v14.20.1 or greater.
4141

42-
New features of the 5.0 {+driver-short+} release include:
42+
- This release removes support for callbacks in favor of a promise-based API.
43+
The following list provides some strategies for callback users to adopt this
44+
version:
45+
46+
- Migrate to the promise-based API (recommended)
47+
- Use the promise-based API and ``util.callbackify``
48+
- Add ``mongodb-legacy`` to continue using callbacks
4349

44-
.. important:: Breaking Change: Removal of Callback Support
50+
For more information about these strategies, see
51+
`Changes in the MongoDB Node.js Driver v5 <https://github.com/mongodb/node-mongodb-native/blob/main/etc/notes/CHANGES_5.0.0.md>`__.
4552

46-
This release removes support for callbacks in favor of a promise-based API.
47-
The following list provides some strategies for callback users to adopt this
48-
version:
53+
- This release removes support for the ``Collection.insert()``,
54+
``Collection.update()``, and ``Collection.remove()`` helper methods.
55+
The following list provides instructions on how to replace the
56+
functionality of the removed methods:
4957

50-
- Migrate to the promise-based API (recommended)
51-
- Use the promise-based API and ``util.callbackify``
52-
- Add ``mongodb-legacy`` to continue using callbacks
58+
- Migrate from ``Collection.insert()`` to ``insertOne()`` or ``insertMany()``
59+
- Migrate from ``Collection.update()`` to ``updateOne()`` or ``updateMany()``
60+
- Migrate from ``Collection.remove()`` to ``deleteOne()`` or ``deleteMany()``
5361

54-
For more information about these strategies, see the `v5 Change Notes <https://github.com/mongodb/node-mongodb-native/blob/main/etc/notes/CHANGES_5.0.0.md>`__.
62+
New features of the 5.0 {+driver-short+} release include:
5563

5664
- By default, the driver no longer checks types referenced in dot notation
5765
unless the ``StrictFilter`` type annotation is explicitly
5866
used. To learn more about this change, see the :ref:`Typescript fundamentals
5967
page <node-ts-type-safety>`.
60-
68+
6169
.. note::
6270

6371
This change is for Typescript only, and does not affect queries or operations
@@ -77,16 +85,6 @@ New features of the 5.0 {+driver-short+} release include:
7785
dependency successfully, the driver uses the AWS SDK itself to
7886
manage credentials from the environment.
7987

80-
.. important:: Breaking Change: Removal of CRUD Helper Methods
81-
82-
This release removes support for the ``Collection.insert()``, ``Collection.update()``, and
83-
``Collection.remove()`` helper methods. The following list provides
84-
instructions on how to replace the functionality of the removed methods:
85-
86-
- Migrate from ``Collection.insert()`` to ``insertOne()`` or ``insertMany()``
87-
- Migrate from ``Collection.update()`` to ``updateOne()`` or ``updateMany()``
88-
- Migrate from ``Collection.remove()`` to ``deleteOne()`` or ``deleteMany()``
89-
9088
.. _version-4.13:
9189

9290
What's New in 4.13

0 commit comments

Comments
 (0)