23.28. 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

23.28.1. Inheritance

objectChangeStreamUpdate

23.28.2. Inherited Members

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

23.28.3. Methods

23.28.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)

23.28.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

23.28.3.1.2. Returns

Task<IChangeStreamCursor<ChangeStreamDocument<T>>>

A containing the filtered modification events

23.28.3.1.3. Type Parameters

T

Type of Document retrieved from the database