diff --git a/source/reference/config/triggers.txt b/source/reference/config/triggers.txt index 49bb148e1..1db9d64ae 100644 --- a/source/reference/config/triggers.txt +++ b/source/reference/config/triggers.txt @@ -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/.json @@ -138,23 +138,40 @@ configuration files: * - | ``config.database`` | String - - The name of the MongoDB database that contains the watched collection. + - The name of the MongoDB database that contains the watched collection. + Optional. * - | ``config.collection`` | String - - The name of the collection that the trigger watches. + - The name of the collection that the trigger watches. Optional. * - | ``config.operation_types`` | String[] - A list of one or more :ref:`database 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:: diff --git a/source/triggers/database-triggers.txt b/source/triggers/database-triggers.txt index a3b93fc80..a042bc7ac 100644 --- a/source/triggers/database-triggers.txt +++ b/source/triggers/database-triggers.txt @@ -344,23 +344,53 @@ following operation types: .. list-table:: :header-rows: 1 - :widths: 10 30 + :widths: 30 15 * - Operation Type - Description - * - **Insert** + * - **Insert Document** (All trigger types) - Represents a new document added to the collection. - * - **Update** + * - **Update Document** (All trigger types) - Represents a change to an existing document in the collection. - * - **Delete** + * - **Delete Document** (All trigger types) - Represents a document deleted from the collection. - * - **Replace** + * - **Replace Document** (All trigger types) - Represents a new document that replaced a document in the collection. + * - **Create_Collection** (Database and Deployment trigger types only) + - Represents the creation of a new collection. + + * - **Modify_Collection** (Database and Deployment trigger types only) + - Represents the modification collection. + + * - **Rename_Collection** (Database and Deployment trigger types only) + - Represents collection being renamed. + + * - **Drop_Collection** (Database and Deployment trigger types only) + - Represents a collection being dropped. + + * - **Shard_Collection** (Database and Deployment trigger types only) + - Represents a collection changing from unsharded to sharded. + + * - **Reshard_Collection** (Database and Deployment trigger types only) + - Represents a change to a collection's sharding. + + * - **Refine_Collection_Shard_Key** (Database and Deployment trigger types only) + - Represents a change in the shard key of a collection. + + * - **Create_Indexes** (Database and Deployment trigger types only) + - Represents the creation of a new index. + + * - **Drop_Indexes** (Database and Deployment trigger types only) + - Represents an index being dropped. + + * - **Drop_Database** (Deployment trigger type only) + - Represents a database being dropped. + Database change event objects have the following general form: .. code-block:: json @@ -747,8 +777,6 @@ the trigger to fire. For details, see the reference for each event type: - :manual:`replace ` - :manual:`delete ` - - .. example:: The following match expression allows the Trigger to fire