kmongo / org.litote.kmongo.coroutine / CoroutineChangeStreamPublisher

CoroutineChangeStreamPublisher

class CoroutineChangeStreamPublisher<TResult : Any> : CoroutinePublisher<ChangeStreamDocument<TResult>> (source)

Coroutine wrapper around ChangeStreamPublisher.

Constructors

<init>

Coroutine wrapper around ChangeStreamPublisher.

CoroutineChangeStreamPublisher(publisher: ChangeStreamPublisher<TResult>)

Properties

publisher

val publisher: ChangeStreamPublisher<TResult>

Functions

batchSize

Sets the number of documents to return per batch.

fun batchSize(batchSize: Int): CoroutineChangeStreamPublisher<TResult>

collation

Sets the collation options

fun collation(collation: Collation): CoroutineChangeStreamPublisher<TResult>

first

Helper to return a publisher limited to the first result.

suspend fun first(): ChangeStreamDocument<TResult>?

fullDocument

Sets the fullDocument value.

fun fullDocument(fullDocument: FullDocument): CoroutineChangeStreamPublisher<TResult>

maxAwaitTime

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

fun maxAwaitTime(maxAwaitTime: Long, timeUnit: TimeUnit): CoroutineChangeStreamPublisher<TResult>

resumeAfter

Sets the logical starting point for the new change stream.

fun resumeAfter(resumeToken: BsonDocument): CoroutineChangeStreamPublisher<TResult>

startAtOperationTime

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

fun startAtOperationTime(startAtOperationTime: BsonTimestamp): CoroutineChangeStreamPublisher<TResult>

withDocumentClass

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

suspend fun <TDocument> withDocumentClass(): List<TDocument>