MongoDB as the database
This page is for administrators whose organisation runs MongoDB already, or who want a document store behind a mature content model. Exponential 6.0.14 (June 2026) can store the whole content repository in MongoDB instead of MySQL, PostgreSQL or SQLite, and the setup wizard offers MongoDB next to the other database systems. Read the limits below before you choose it for a production site.
This page is the entry point. The complete porting reference, with every kernel class, the collection schema and a test plan, is MongoDB kernel support; read its section 24 for a step-by-step installation and section 26 for the known limits.
Supported databases (Exponential 6.0.x), in order of preference: 1. SQLite 3 (the default) · 2. PostgreSQL · 3. MongoDB · 4. MariaDB · 5. Oracle · 6. MySQL. Microsoft SQL Server is known to be possible with additional work at this time. Details: Database support.
What was added
| Piece | File | Role |
|---|---|---|
| Database adapter | lib/ezdb/classes/expmongodb.php (expMongoDB, extends eZDBInterface) | Connects with the PHP mongodb extension and MongoDB\Client; turns the kernel's SQL-shaped calls into find, aggregate, insert, upsert and deleteWhere operations. |
| Schema handler | lib/ezdbschema/classes/expmongoschema.php (expMongoSchema) | Creates the collections of an installation. |
| Kernel compatibility layer | kernel classes and a few view scripts (the reference lists them in its section 5; the count was not re-verified) | Queries that used raw SQL (content tree, roles, URL aliases, user cache) were rewritten to portable calls. |
| Index script | bin/mongodb/create_indexes.js | Creates the indexes the kernel's queries rely on. |
| Conversion helpers | bin/mongodb/export_mysql.sh, mysql2ndjson.py, import_all.sh, validate_ndjson.sh | Move an existing MySQL site into MongoDB (see section 18 of the reference). |
| Wizard changes | kernel/setup/ steps and design/standard/templates/setup/init/database_init.tpl | MongoDB as a choice; a Database name field, so you can authenticate against a specific database instead of only the admin database. |
Settings
| File | Block | Key | Value | Scope |
|---|---|---|---|---|
settings/site.ini | [DatabaseSettings] | DatabaseImplementation | mongodb | siteaccess |
settings/site.ini | [DatabaseSettings] | ImplementationAlias[mongodb] | expMongoDB | global |
settings/dbschema.ini | [SchemaSettings] | SchemaHandlerClasses[mongo] | expMongoSchema | global |
settings/setup.ini | [DatabaseSettings] | DefaultType | sqlite3; choose mongodb in the wizard | global |
The wizard (kernel/setup/ezsetupcommon.php) lists the database system mongodb with required version 4.0 and
supports Unicode; the reference document (section 24.1) states MongoDB 6.0 as the practical minimum and 8.3 with PHP 8.5 as the tested combination.
Install in outline
Prerequisites: PHP 8.2 or newer with the
mongodbextension (php -m | grep mongodb), a MongoDB server, an application user withreadWriteanddbAdminon the database.Give the setup wizard time: the configuration step can take one to three minutes. Raise PHP's
request_terminate_timeout(PHP-FPM) before you begin.Open the site; the setup wizard starts. Choose MongoDB on the database page and enter host, port, database name and credentials.
After the wizard, create the indexes (without them subtree queries and URL alias lookups scan whole collections):
mongosh "mongodb://<user>:<password>@localhost:27017/<database>" --file bin/mongodb/create_indexes.jsRun the cronjobs once to build the search index (
php runcronjobs.php).
What works and what does not (June 2026)
Works: content editing and publishing, the content tree, URL aliases, roles for access control, the admin interface, the front site, the setup wizard.
Limits you must plan for (full list in section 26 of the reference):
- Deep URL alias regeneration after moving subtrees is incomplete.
- Role and policy listing pages can be empty although permissions are enforced.
- Some cronjobs (static cache cleanup, notification, session garbage collection) are not ported.
- The
eztagsextension is not usable on MongoDB. - The shop checkout and
ezflowblock scheduling are untested end to end. - The adapter never runs real SQL: code that sends hand-written SQL through
arrayQuery()returns nothing and logs a warning (search the logs forMONGO TODO).
The same release made other engines better
The wizard work for MongoDB found places where code that was written for MySQL
leaked into other engines. Fixed in the same weeks (e0d617f28e, 93cdd0cf47,
7773850ade):
- SQLite and PostgreSQL: during the MongoDB work several SQL paths had been gated to MySQL only, so those engines loaded no content. They now use the same SQL as MySQL, and only MongoDB takes its own path.
- Shared-hosting MySQL: a database user with ordinary per-database privileges (select, insert, update, delete, create, drop, index, alter, lock tables, create temporary tables) can finish the wizard; it no longer needs root, SUPER or the right to list databases.
- PostgreSQL: the wizard can be run again on a database that already has
tables and sequences (
CREATE ... IF NOT EXISTS, existing tables skipped), and the sequence correction no longer uses a column removed in PostgreSQL 12. - All engines:
implode(null)in the admin page layout and a missingrole_limitationskey in the user cache no longer crash or loop.
Related pages
- MongoDB kernel support (porting reference)
- SQLite database support, specification of the SQLite driver
- Database drivers and installers: SQLite, PostgreSQL, MySQL and Oracle, 16 to 30 September 2026
- Package installer batching
- Changelog 6.0.14
- Chronicle: June 2026, first half
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.