Skip to content

Commit 2348b7a

Browse files
committed
docs(migrating_to_8): add id setter change to migration guide
Fix #13784
1 parent 01202a5 commit 2348b7a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/migrating_to_8.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ If you're still on Mongoose 6.x or earlier, please read the [Mongoose 6.x to 7.x
1515
* [Changed behavior for `findOneAndUpdate()` with `orFail()` and upsert](#changed-behavior-for-findoneandupdate-with-orfail-and-upsert)
1616
* [MongoDB Node Driver 6.0](#mongodb-node-driver-6)
1717
* [Removed `findOneAndRemove()`](#removed-findoneandremove)
18+
* [Removed id Setter](#removed-id-setter)
1819

1920
<h2 id="removed-rawresult-option-for-findoneandupdate"><a href="#removed-rawresult-option-for-findoneandupdate">Removed <code>rawResult</code> option for <code>findOneAndUpdate()</code></a></h2>
2021

@@ -54,3 +55,8 @@ There's a few noteable changes in MongoDB Node driver v6 that affect Mongoose:
5455
In Mongoose 7, `findOneAndRemove()` was an alias for `findOneAndDelete()` that Mongoose supported for backwards compatibility.
5556
Mongoose 8 no longer supports `findOneAndRemove()`.
5657
Use `findOneAndDelete()` instead.
58+
59+
<h2 id="removed-id-setter"><a href="#removed-id-setter">Removed id Setter</a></h2>
60+
61+
In Mongoose 7.4, Mongoose introduced an `id` setter that made `doc.id = '0'.repeat(24)` equivalent to `doc._id = '0'.repeat(24)`.
62+
In Mongoose 8, that setter is now removed.

0 commit comments

Comments
 (0)