- Adds the upsert method to the database interface - Adds a mongodb specific option to extend the updateOne to accept mongoDB Query Options (to pass `upsert: true`) - Added upsert method to all database adapters - Uses db.upsert in the payload preferences update operation Includes a test using payload-preferences
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.