- reduces unnecessary shallow copying within operations by removing unnecessary spreads or .map()'s - removes unnecessary `deleteMany` call in `deleteUserPreferences` for auth-enabled collections - replaces all instances of `validOperators.includes` with `validOperatorMap[]`. O(n) => O(1) - optimizes the `sanitizeInternalFields` function. Previously, it was doing a **lot** of shallow copying
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.