payloadcms / payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
https://payloadcms.com
MIT License
21.17k stars 1.28k forks source link

Dependency: Update `mongodb` package to v5 or v6 #4617

Open charkour opened 6 months ago

charkour commented 6 months ago

Link to reproduction

No response

Describe the Bug

Hi Payload Team,

Many Payload users are hosting their MongoDB instance on Atlas as per the Payload Docs. This works great, however, Atlas is updating their Mongo instances from v6 to v7 in February 2024 (see photo). Looking at the Node.js MongoDB compatibility guide, to use v7, it's recommended to use v5 or v6 of the npm package mongodb; however, it's likely v4.17.1 (which is currently used in @payloadcms/db-mongodb) will continue to work with the v7 Mongo Atlas instance. When Atlas updates instance versions, there is a potential for bugs to occur for Payload users hosting Mongo on Atlas.

Email from Mongo Atlas ![image](https://github.com/payloadcms/payload/assets/33156025/576cc845-5e5d-4c1f-b868-58ac41e6e1d0)

Thank you

To Reproduce

Visit https://github.com/payloadcms/payload/blob/657d14c07b4c6da4f168a6b6853f932c44527639/packages/db-mongodb/package.json#L36C3-L36C24 and note this version is v4.x and not v5 or v6 on the Node.js MongoDB compatibility guide.

Payload Version

^2.x

Adapters and Plugins

db-mongodb

cbratschi commented 6 months ago

Payload is still using Mongoose 6.x where 8.x was just released: https://www.npmjs.com/package/mongoose.

I am using MongoDB 7.x and never had any issues with Mongoose 6.x.

charkour commented 6 months ago

Thanks for the info, @cbratsch!