On Collection Modified
AI-generatedSummary
Listens to a Firestore collection and triggers when an existing document in that collection is modified, optionally filtered by field conditions.
Inputs
- Path (required) — Required. The Firestore collection to listen to. For On Collection Modified, this must be a collection path (e.g.
usersorusers/123/posts), not a document path. - Filters — Optional. A fixed collection of conditions. If configured, the trigger only fires when the modified document data satisfies all conditions. Each condition contains:
- Key: field name; use dot notation for nested maps.
- Comparison:
==,!=,<,<=,>,>=,array-contains,not-in,exists,not-exists,is-empty,is-not-empty,array-contains-any, orin. - Value: the value to compare; ignored by existence/empty operators.
- Value Type: how to parse Value — string, number, boolean, map/array JSON, null, timestamp, geopoint (
lat,lon), or reference path.
Multiple conditions are ANDed. Filters are evaluated against the serialized document data (e.g. Timestamps as ISO strings).
Output shape
Array of items; each item is { id, path, ...documentFields }.
When a Firestore snapshot contains modified documents that pass the filters, the trigger emits one array of items. Each item's JSON is
{ "id": "<docId>", "path": "<full document path>", ...documentFields }. Firestore Timestamps become ISO strings, GeoPoints become{ latitude, longitude }, references become path strings, and nested objects/arrays are converted recursively.
Examples
Example 1: This trigger uses Firestore's onSnapshot listener on the collection path in the `Path` parameter. For each snapshot, it looks at document changes of type `modified`. If any modified documents pass all configured filters, the node emits them as items. It does not create, update, or delete data; it only reacts to changes.
Triggers when an existing document in a Firestore collection is modified, optionally filtered by field conditions.