The subscription blocks help us know when a modification has been done in the database. That modification can be a Create, Update or Delete.
Starts the subscription, so it "listens" for changes in the database, when a truthy value is provided. When a change in the databse happens the output(change) is passed to the value.
Mutate Types: List (Array)
Mutate Types help us filter the subscription results based on the change that happened. The mutateTypes list can contain one or more of the following values:
- Filters: Object
With filters we have the ability to receive only the changes on records that follow some specific criteria.
Outputs when execute is activated. The ouput consists of the following fields:
- id: Text (String)
Id is the unique key of the record that was modified.
- mutateType: Text (String):
This field describes the type of change that happened.The mutate type can have one of the following values:
- oldDocument: Object of the previous value of the record that was modified.
- newDocument: Object of the new value of the record that was modified.