Table of Contents

Class FirestoreDataChangeEvent

Namespace
Excalibur.Cdc.Firestore
Assembly
Excalibur.Cdc.Firestore.dll

Represents a data change event captured from Firestore Realtime Listeners.

public sealed class FirestoreDataChangeEvent
Inheritance
FirestoreDataChangeEvent
Inherited Members

Properties

ChangeType

Gets the type of change (Added, Modified, Removed).

public FirestoreDataChangeType ChangeType { get; init; }

Property Value

FirestoreDataChangeType

CollectionPath

Gets the collection path this change came from.

public string CollectionPath { get; init; }

Property Value

string

CreateTime

Gets the document create time from Firestore metadata.

public DateTimeOffset? CreateTime { get; init; }

Property Value

DateTimeOffset?

DocumentData

Gets the document data after the change.

public IReadOnlyDictionary<string, object>? DocumentData { get; init; }

Property Value

IReadOnlyDictionary<string, object>

Remarks

Available for Added and Modified events. Null for Removed events.

DocumentId

Gets the document ID within the collection.

public string DocumentId { get; init; }

Property Value

string

Position

Gets the position of this change in the stream.

public FirestoreCdcPosition Position { get; init; }

Property Value

FirestoreCdcPosition

Timestamp

Gets the timestamp when the change occurred.

public DateTimeOffset Timestamp { get; init; }

Property Value

DateTimeOffset

UpdateTime

Gets the document update time from Firestore metadata.

public DateTimeOffset? UpdateTime { get; init; }

Property Value

DateTimeOffset?

Remarks

This is the server-side timestamp from Firestore, used for position tracking.

Methods

CreateAdded(FirestoreCdcPosition, string, string, IReadOnlyDictionary<string, object>?, DateTimeOffset, DateTimeOffset?, DateTimeOffset?)

Creates a new instance for an added event.

public static FirestoreDataChangeEvent CreateAdded(FirestoreCdcPosition position, string collectionPath, string documentId, IReadOnlyDictionary<string, object>? documentData, DateTimeOffset timestamp, DateTimeOffset? updateTime, DateTimeOffset? createTime)

Parameters

position FirestoreCdcPosition

The CDC position.

collectionPath string

The collection path.

documentId string

The document ID.

documentData IReadOnlyDictionary<string, object>

The document data.

timestamp DateTimeOffset

The event timestamp.

updateTime DateTimeOffset?

The document update time.

createTime DateTimeOffset?

The document create time.

Returns

FirestoreDataChangeEvent

A new change event.

CreateModified(FirestoreCdcPosition, string, string, IReadOnlyDictionary<string, object>?, DateTimeOffset, DateTimeOffset?, DateTimeOffset?)

Creates a new instance for a modified event.

public static FirestoreDataChangeEvent CreateModified(FirestoreCdcPosition position, string collectionPath, string documentId, IReadOnlyDictionary<string, object>? documentData, DateTimeOffset timestamp, DateTimeOffset? updateTime, DateTimeOffset? createTime)

Parameters

position FirestoreCdcPosition

The CDC position.

collectionPath string

The collection path.

documentId string

The document ID.

documentData IReadOnlyDictionary<string, object>

The document data.

timestamp DateTimeOffset

The event timestamp.

updateTime DateTimeOffset?

The document update time.

createTime DateTimeOffset?

The document create time.

Returns

FirestoreDataChangeEvent

A new change event.

CreateRemoved(FirestoreCdcPosition, string, string, DateTimeOffset)

Creates a new instance for a removed event.

public static FirestoreDataChangeEvent CreateRemoved(FirestoreCdcPosition position, string collectionPath, string documentId, DateTimeOffset timestamp)

Parameters

position FirestoreCdcPosition

The CDC position.

collectionPath string

The collection path.

documentId string

The document ID.

timestamp DateTimeOffset

The event timestamp.

Returns

FirestoreDataChangeEvent

A new change event.