MongoDB Adapter

Stores Payload collections and globals in a MongoDB database

Official 45,915 160.4k/wk MIT v3.94.0

Installation

pnpm add @payloadcms/db-mongodb

About

This adapter connects Payload to MongoDB, so collections, globals and their documents are saved in a MongoDB database instead of a SQL store. It is the officially supported database option for teams whose infrastructure already runs on MongoDB or who prefer a document model. Payload handles the admin panel, access control and APIs as usual, and the adapter takes care of reading and writing the data underneath. Local development can run against an in-memory MongoDB instance, and migrations are supported for changes to the data layout over time.

Package info

Package name
@payloadcms/db-mongodb
Latest version
3.94.0
Unpacked size
894 kB
License
MIT
Weekly downloads
160.4k
Last publish
Nov 17, 2026

More from payloadcms

View profile

Stores Payload upload files in Cloudflare R2 buckets instead of local disk

Adds a parent field and breadcrumbs to collections so documents can nest inside each other

Sends Payload server errors and selected HTTP errors to Sentry with user context

Adds an SEO tab with meta title, description, image and search preview to collections

Stores collection uploads in Vercel Blob Storage instead of local disk

Lets one Payload admin panel manage content for many separate tenants

Similar adapters

More in Database

Database adapter that runs Payload on SurrealDB through its PostgreSQL-compatible SQL interface

Stores Payload data in a Postgres database, with migrations and read replica support

Vercel Postgres database adapter that stores Payload collections and globals in Postgres

Stores Payload data in Cloudflare D1 SQLite databases from Workers

Official SQLite database adapter that stores Payload collections and globals in SQLite

Database adapter that maps Payload collections onto an existing Prisma schema