kmongo / org.litote.kmongo.coroutine / CoroutineDatabase / watch

watch

fun <reified TResult : Any> watch(pipeline: List<Bson> = emptyList()): CoroutineChangeStreamPublisher<TResult> (source)

Creates a change stream for this database.

Parameters

pipeline - the aggregation pipeline to apply to the change stream

Parameters

Return
the change stream iterable

Mongodb
.driver.dochub core/changestreams Change Streams

Since
1.9

Mongodb
.server.release 4.0

fun <reified TResult : Any> watch(clientSession: ClientSession, pipeline: List<Bson> = emptyList()): CoroutineChangeStreamPublisher<TResult> (source)

Creates a change stream for this database.

Parameters

clientSession - the client session with which to associate this operation

pipeline - the aggregation pipeline to apply to the change stream

Parameters

Return
the change stream iterable

Since
1.9

Mongodb
.server.release 4.0

Mongodb
.driver.dochub core/changestreams Change Streams