Skip to content

Commit

Permalink
docs(migrating_to_8): add id setter change to migration guide
Browse files Browse the repository at this point in the history
Fix #13784
  • Loading branch information
vkarpov15 committed Sep 26, 2023
1 parent 01202a5 commit 2348b7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/migrating_to_8.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ If you're still on Mongoose 6.x or earlier, please read the [Mongoose 6.x to 7.x
* [Changed behavior for `findOneAndUpdate()` with `orFail()` and upsert](#changed-behavior-for-findoneandupdate-with-orfail-and-upsert)
* [MongoDB Node Driver 6.0](#mongodb-node-driver-6)
* [Removed `findOneAndRemove()`](#removed-findoneandremove)
* [Removed id Setter](#removed-id-setter)

<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>

Expand Down Expand Up @@ -54,3 +55,8 @@ There's a few noteable changes in MongoDB Node driver v6 that affect Mongoose:
In Mongoose 7, `findOneAndRemove()` was an alias for `findOneAndDelete()` that Mongoose supported for backwards compatibility.
Mongoose 8 no longer supports `findOneAndRemove()`.
Use `findOneAndDelete()` instead.

<h2 id="removed-id-setter"><a href="#removed-id-setter">Removed id Setter</a></h2>

In Mongoose 7.4, Mongoose introduced an `id` setter that made `doc.id = '0'.repeat(24)` equivalent to `doc._id = '0'.repeat(24)`.
In Mongoose 8, that setter is now removed.

0 comments on commit 2348b7a

Please sign in to comment.