ChangeStreamFlow

interface ChangeStreamFlow<out TResult : Any> : Flow<ChangeStreamDocument<out TResult>>

Flow for change streams.

Since

3.6

Parameters

The type of the result.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun batchSize(batchSize: Int): ChangeStreamFlow<TResult>

Sets the number of documents to return per batch.

Link copied to clipboard
abstract fun collation(collation: Collation?): ChangeStreamFlow<TResult>

Sets the collation options

Link copied to clipboard
abstract suspend fun collect(collector: FlowCollector<ChangeStreamDocument<out TResult>>)
Link copied to clipboard
abstract suspend fun firstOrNull(): ChangeStreamDocument<out TResult>?

Helper to return first result.

Link copied to clipboard
abstract fun fullDocument(fullDocument: FullDocument): ChangeStreamFlow<TResult>

Sets the fullDocument value.

Link copied to clipboard
abstract fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): ChangeStreamFlow<TResult>

Sets the maximum await execution time on the server for this operation.

Link copied to clipboard
abstract fun resumeAfter(resumeToken: BsonDocument): ChangeStreamFlow<TResult>

Sets the logical starting point for the new change stream.

Link copied to clipboard
abstract fun startAfter(startAfter: BsonDocument): ChangeStreamFlow<TResult>

Similar to resumeAfter, this option takes a resume token and starts a new change stream returning the first notification after the token.

Link copied to clipboard
abstract fun startAtOperationTime(startAtOperationTime: BsonTimestamp): ChangeStreamFlow<TResult>

The change stream will only provide changes that occurred after the specified timestamp.

Link copied to clipboard
abstract fun <TDocument : Any> withDocumentClass(clazz: KClass<out TDocument>): Flow<TDocument>

Returns a Flow containing the results of the change stream based on the document class provided.