Docs Menu

View & Disable Collection-level Preimages

On this page

  • Overview
  • View Preimage-Enabled Collections
  • Disable Preimages for a Collection

You can configure database triggers to include a document preimage in their change events. A preimage is a snapshot of a modified document from just before the modification was applied.

To support document preimages, Realm includes additional information in the linked cluster's oplog. This adds a small amount of storage overhead to each operation on the collection and may cause performance issues for collections with a high write throughput. Once you have enabled preimages for a collection, any trigger on the collection may enable document preimages with no additional overhead.


For information on how to enable document preimages for a specific trigger, see Create a Database Trigger.

To see a list of collections that are configured to store document preimages in their oplog, navigate to the Linked Data Source configuration screen and find the Preimage Preferences by Collection table.

The table lists every collection that stores preimages in the oplog. This includes all collections in the linked cluster, even if no triggers currently use the preimages for a collection or if the triggers are in a different Realm app.

You can disable collection-level preimages in the Realm UI. Once disabled, the oplog no longer includes preimages for documents in the collection. To disable preimages for a collection:

  1. (Optional) Disable document preimages for all triggers on the collection. When collection-level preimages are disabled, triggers on the collection that still have preimages enabled (including triggers in other Realm apps) will continue to execute but will not include the fullDocumentBeforeChange field in change events.
  2. Disable sync, if the collection is part of a synced cluster.
  3. On the linked cluster configuration screen, find the collection in the Preimage Preferences by Collection table and then click Disable.
Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.


  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.