### What? Uses the `collection.dbName` property for the Mongoose model, if defined. ### Why? Currently, `collection.dbName` is used for the version name but not for the actual collection name. Additionally, `autoPluralization` modifies the `dbName` regardless. This behavior is inconsistent and contradicts the documentation. ### How? - Utilize `collection.dbName` instead of `collection.slug`. - Disable `autoPluralization` for collections with a defined `dbName`. Related: https://github.com/payloadcms/payload/discussions/9058 **BREAKING CHANGES** If a `dbName` was previously provided, it will now be used as the MongoDB collection name instead of the collection `slug`. `autoPluralization` will not be applied to `dbName`. --------- Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Payload MongoDB Adapter
Official MongoDB adapter for Payload.
Installation
npm install @payloadcms/db-mongodb
Usage
import { buildConfig } from 'payload'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
export default buildConfig({
db: mongooseAdapter({
url: process.env.DATABASE_URI,
}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.