26.33. Class ChangeStreamUpdate

Namespace: ArmoniK.Core.Adapters.MongoDB
Assembly: ArmoniK.Core.Adapters.MongoDB.dll

Helper class to get stream updates (events produced when there is an action on the db used by replication) from MongoDB collection

public static class ChangeStreamUpdate

26.33.1. Inheritance

objectChangeStreamUpdate

26.33.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

26.33.3. Methods

26.33.3.1. GetUpdates<T>(IMongoCollection<T>, IClientSessionHandle, Expression<Func<T, bool>>, IEnumerable<string>, CancellationToken)

Listen to the change stream with filtering and returns the matching events

public static Task<IChangeStreamCursor<ChangeStreamDocument<T>>> GetUpdates<T>(IMongoCollection<T> collection, IClientSessionHandle sessionHandle, Expression<Func<T, bool>> filter, IEnumerable<string> fields, CancellationToken cancellationToken = default)

26.33.3.1.1. Parameters

collection IMongoCollection<T>

Collection containing the data

sessionHandle IClientSessionHandle

MongoDB session

filter Expression<Func<T, bool>>

Filter to select the updates that the function will return

fields IEnumerable<string>

List of fields to watch for modifications

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.33.3.1.2. Returns

Task<IChangeStreamCursor<ChangeStreamDocument<T>>>

A containing the filtered modification events

26.33.3.1.3. Type Parameters

T

Type of Document retrieved from the database