feat(db-mongodb)!: update mongoose to 8.8.1 (#9115)

### What?
Upgrades mongoose from 6 to latest `v8.8.1`

Fixes https://github.com/payloadcms/payload/issues/9171

### Why?
Compatibilty with Mongodb Atlas

### How?
- Updates deps
- Changed ObjectId from bson-objectid to use `new Type.ObjectId` from
mongoose for compatibility (only inside of db-mongodb)
- Internal type adjustments

https://github.com/payloadcms/payload/discussions/9088

BREAKING CHANGES:
All projects with existing data having versions enabled, or relationship or upload fields will want to create the predefined migration that converts all strings to ObjectIDs where needed. This can be created using `payload migrate:create --file @payloadcms/mongodb/relationships-v2-v3`.
For projects making use of the exposed Models from mongoose, review the
upgrade guides from [v6 to
v7](https://mongoosejs.com/docs/7.x/docs/migrating_to_7.html) and [v7 to
v8](https://mongoosejs.com/docs/migrating_to_8.html) and make
adjustments as needed.

---------

Co-authored-by: Sasha <64744993+r1tsuu@users.noreply.github.com>
This commit is contained in:
Dan Ribbens
2024-11-15 12:03:56 -05:00
committed by GitHub
parent 028153f5a4
commit 7c6f41936b
36 changed files with 1446 additions and 388 deletions

View File

@@ -71,6 +71,7 @@
"http-status": "1.6.2",
"jwt-decode": "4.0.0",
"lexical": "0.20.0",
"mongoose": "8.8.1",
"next": "15.0.0",
"payload": "workspace:*",
"qs-esm": "7.0.2",