Skip to content

Commit

Permalink
New Database Trigger Options (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
MongoCaleb authored Nov 1, 2023
1 parent b35e4fc commit 37b3d5d
Show file tree
Hide file tree
Showing 2 changed files with 253 additions and 85 deletions.
31 changes: 22 additions & 9 deletions source/reference/config/triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Database Triggers

Database trigger configurations conform to the base trigger schema with
additional configuration options that specify which collection to watch and when
to fire the trigger. The following fields exist in *database* trigger
configuration files:
to fire the trigger. The following fields exist in *database* and *deployment*
trigger configuration files:

.. code-block:: json
:caption: triggers/<trigger name>.json
Expand Down Expand Up @@ -149,12 +149,28 @@ configuration files:
- A list of one or more :ref:`database operation
types <database-event-operation-types>` that cause the trigger to fire.

Valid operations types:
Valid operations types for all triggers:

- ``"INSERT"``
- ``"UPDATE"``
- ``"REPLACE"``
- ``"DELETE"``

Valid operations types for database and deployment triggers:

- ``"CREATE_COLLECTION"``
- ``"MODIFY_COLLECTION"``
- ``"RENAME_COLLECTION"``
- ``"SHARD_COLLECTION"``
- ``"DROP_COLLECTION"``
- ``"RESHARD_COLLECTION"``
- ``"REFINE_COLLECTION_SHARD_KEY"``
- ``"CREATE_INDEXES"``
- ``"DROP_INDEXES"``

Valid operations types for deployment triggers only:

- ``"DROP_DATABASE"``

.. tip::

Expand All @@ -172,12 +188,9 @@ configuration files:

.. note::

Regardless of this setting:

- ``INSERT`` and ``REPLACE`` events always include the
``fullDocument`` field.

- ``DELETE`` events never include the ``fullDocument`` field.
Regardless of this setting, ``INSERT`` and ``REPLACE`` events always
include the``fullDocument`` field. ``DELETE`` events never include the
``fullDocument`` field.

* - | ``config.full_document_before_change``
| ``boolean``
Expand Down
Loading

0 comments on commit 37b3d5d

Please sign in to comment.