22.32. 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
22.32.1. Inheritance
22.32.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
22.32.3. Methods
22.32.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)
22.32.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
22.32.3.1.2. Returns
Task<IChangeStreamCursor<ChangeStreamDocument<T>>>
A
22.32.3.1.3. Type Parameters
T
Type of Document retrieved from the database