Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Mongo Entity provides developers with entity and controller classes for storing entities entirely in a MongoDB collection. It eliminates the need for a base table, or any SQL queries at all; an entity's ID, name, properties, and any field data are all written directly to MongoDB. It also provides classes for embedded entities: entities that are stored as subdocuments in a parent collection, but that can be managed using the standard Entity API CRUD methods, as well as found with EntityFieldQuery. Ultimately, loading a parent entity should automatically load and embed all its child entities, with only one query to a single MongoDB collection.
Mongo Entity is for developers. It provides no interface, nor does it alter the behavior of existings sites out of the box. Modules can use the provided MongoEntity and MongoEntityController classes in hook_entity_info to store entities in MongoDB, rather than a SQL database.
Features
Minimal configuration. Save custom Entities entirely in automatically generated MongoDB collections. No SQL tables needed.
Performance boost. Field data is stored with the Entity in MongoDB, reducing the need for complex JOINs and multiple database queries to load a single object.