kmongo / org.litote.kmongo.coroutine / CoroutineCollection / watch

watch

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

Creates a change stream for this collection.

Parameters

pipeline - the aggregation pipeline to apply to the change stream

Parameters

Return
the change stream iterable

Mongodb
.driver.manual reference/operator/aggregation/changeStream $changeStream

Since
1.6

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

Creates a change stream for this collection.

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

Mongodb
.driver.manual reference/operator/aggregation/changeStream $changeStream

Mongodb
.server.release 3.6

Since
1.7