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

MongoDB: limits and operations

What the MongoDB adapter of Exponential cannot do yet, how to find untranslated SQL in the logs, how upgrades work without SQL update files, backups with mongodump, the migration scripts in bin/mongodb, and what to…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/help/database-administrators/mongodb-limits-and-operations.md

On this page

MongoDB: limits and operations

This page is for database administrators who decide whether MongoDB fits a site, or who already run one. It answers: what the adapter does not support, how to recognize a feature that silently returns nothing, how upgrades and schema checks work without SQL, how to back up, and how a MySQL site is moved to MongoDB. Sources: MongoDB as the database, 9.5 MongoDB and section 26 of the porting reference.

Contents

  1. How the adapter works
  2. Known limits
  3. Finding untranslated SQL
  4. Upgrades without SQL files
  5. Backups
  6. Moving a MySQL site to MongoDB
  7. Performance
  8. Checklist

How the adapter works

expMongoDB never runs real SQL. It parses the kernel's SQL-shaped calls and turns them into find, aggregate, insert, upsert and delete operations on collections named like the kernel's tables (ezcontentobject, ezcontentobject_tree and so on). Its schema handler is expMongoSchema (settings/dbschema.ini, type mongo). eZDB::instance()->databaseName() returns mongo.

Known limits

Since Exponential 6.0.15 a SELECT the adapter cannot turn into MongoDB operations (joins, GROUP BY with HAVING, UNION, derived tables, sub-selects) is answered by the SQL fallback: the collections the statement names are copied into an in-memory SQLite database, typed by the .dba schema, and the statement runs there, so it returns what MySQL, PostgreSQL and SQLite return. The copy is kept until the next write through the adapter or for two seconds. Settings in site.ini [DatabaseSettings]:

SettingDefaultWhat it does
MongoSQLFallbackenableddisabled restores the behavior of 6.0.14: an empty result and a MONGO TODO warning
MongoSQLFallbackMaxRows200000a collection with more documents is not copied; the statement is refused as before
MongoSQLFallbackLifetime2seconds a copy keeps answering when no write came in between

The fallback needs PHP's sqlite3 extension (bundled with PHP). It costs a read of every document of the collections involved, so the kernel's frequent paths keep their own MongoDB pipelines; the fallback serves the admin views, reports, cronjobs and extensions that send SQL of their own.

What remains:

  • A SELECT over a collection larger than MongoSQLFallbackMaxRows, and a write that needs SQL (an UPDATE or DELETE with a join or a sub-select the adapter cannot read), are refused and logged. An empty result is not an answer: code that decides access with its own SQL must read it as "no", never as "nothing restricts this".
  • The SQL query cache does not apply.
  • There are no SQL update files.
  • Errors: errorNumber() reports MongoDB's codes (11000 for a duplicate key); the driver answers false and throws nothing (Database error codes and messages).

Measured on 18 November 2026 with the same site package installed on SQLite, MongoDB and Oracle: the front end and the admin pages, content creation, publishing, moving with URL aliases, roles, tags, search, the cronjob parts and the trash give the same results on MongoDB as on SQLite; the details are in Database support. Earlier limits of this page (deep URL alias regeneration after a move, empty role and policy lists, cronjobs, eztags) no longer apply.

Test every extension and every workflow your site uses on a staging copy before you go live.

Finding untranslated SQL

Search the logs for the marker the adapter writes:

grep -rn "MONGO TODO" var/log/ | tail -20
grep -rn "sqlFallback\|refused" var/log/error.log | tail -20

A MONGO TODO warning appears only with MongoSQLFallback=disabled; with the fallback on, a statement it could not answer is logged as an error that starts with expMongoDB::sqlFallback (too many documents, or SQL that SQLite does not accept). Each hit names a statement that returned an empty result instead of data. A page that shows "nothing found" where other engines show content usually has a hit here. Report kernel statements on the software tracker; fix your own extensions' SQL (Reviewing extension SQL for every engine).

Upgrades without SQL files

MongoDB has no update/database/ directory. What replaces it:

  • Setup > Upgrade check, "Check database consistency", compares collections instead of tables: missing collections grouped by feature, collections not in the schema, and the mongosh commands that create the missing ones (The upgrade check).
  • php update/common/scripts/6.0/createaudittables.php creates the audit index collections of 6.0.15 through the schema handler (--dry-run first).
  • The trash documents get trashed_by and trashed_via when written; older ones read as their defaults, so movetrashrecords.php runs as on the other engines.
  • Run bin/mongodb/create_indexes.js again after an upgrade.

See 11.3 The update files.

Backups

mongodump --uri="mongodb://exponential@localhost:27017/exponential" --out=/backup/$(date +%F)
mongorestore --uri="mongodb://exponential@localhost:27017/exponential" --drop /backup/2026-10-05

The tools ask for the password when the URI has none. Replica sets, oplog-based point-in-time backups and snapshots are MongoDB's own features and work as with any client. Back up var/storage and settings/override with the database (Backups per engine).

Moving a MySQL site to MongoDB

The scripts in bin/mongodb/ move an existing MySQL site:

ScriptRole
export_mysql.shdumps every Exponential table from MySQL to NDJSON (the password comes from MYSQL_PASSWORD)
mysql2ndjson.pythe converter export_mysql.sh calls
fixup_ndjson.pypost-processes the files: integer _ids, NULL strings dropped, known integer fields cast
validate_ndjson.shchecks that each file is valid JSON, one object per line; exit 1 on errors
import_all.shimports the files into MongoDB in dependency order

The procedure is section 18 of the porting reference. Plan a maintenance window, then create the indexes and run the cronjobs (Moving a site to another engine).

Performance

Performance follows the number of statements per page, because each kernel call becomes one or more MongoDB operations. The indexes from create_indexes.js are the first lever; the caches in front of the database are the second (Performance and scaling).

Checklist

  • To do: Every extension and workflow tested on staging; no MONGO TODO in the logs after a full click-through.
  • To do: eztags, shop checkout and ezflow not needed, or tested.
  • To do: Indexes created after install and after each upgrade.
  • To do: Upgrade check run after each upgrade; missing collections created.
  • To do: mongodump backups scheduled and a restore tested.

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