Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

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…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/features/6.0/mongodb-database-support.md

On this page

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

PieceFileRole
Database adapterlib/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 handlerlib/ezdbschema/classes/expmongoschema.php (expMongoSchema)Creates the collections of an installation.
Kernel compatibility layerkernel 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 scriptbin/mongodb/create_indexes.jsCreates the indexes the kernel's queries rely on.
Conversion helpersbin/mongodb/export_mysql.sh, mysql2ndjson.py, import_all.sh, validate_ndjson.shMove an existing MySQL site into MongoDB (see section 18 of the reference).
Wizard changeskernel/setup/ steps and design/standard/templates/setup/init/database_init.tplMongoDB as a choice; a Database name field, so you can authenticate against a specific database instead of only the admin database.

Settings

FileBlockKeyValueScope
settings/site.ini[DatabaseSettings]DatabaseImplementationmongodbsiteaccess
settings/site.ini[DatabaseSettings]ImplementationAlias[mongodb]expMongoDBglobal
settings/dbschema.ini[SchemaSettings]SchemaHandlerClasses[mongo]expMongoSchemaglobal
settings/setup.ini[DatabaseSettings]DefaultTypesqlite3; choose mongodb in the wizardglobal

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

  1. Prerequisites: PHP 8.2 or newer with the mongodb extension (php -m | grep mongodb), a MongoDB server, an application user with readWrite and dbAdmin on the database.

  2. 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.

  3. Open the site; the setup wizard starts. Choose MongoDB on the database page and enter host, port, database name and credentials.

  4. 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.js
  5. Run 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 eztags extension is not usable on MongoDB.
  • The shop checkout and ezflow block 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 for MONGO 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 missing role_limitations key in the user cache no longer crash or loop.

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x