### What? Fixes potential errors when passed to `sanitizeRelationships` `ref` could potentially be a non object (for example `string`) because of having in the database data in old structure. ``` "Cannot create property 'a' on string 'B'", ``` ### Why? Necessary particularly for the migration script, as it migrates everything including versions that can have outdated data. ### How? Ensures passed `ref` is an `object`.
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.