watch

@JvmName(name = "watchAsDocument")
fun watch(pipeline: List<Bson> = emptyList()): ChangeStreamFlow<Document>

Creates a change stream for this database.

Return

the change stream iterable

Parameters

pipeline

the aggregation pipeline to apply to the change stream, defaults to an empty pipeline.

See also

Change Streams(https://dochub.mongodb.org/changestreams]


inline fun <T : Any> watch(pipeline: List<Bson> = emptyList()): ChangeStreamFlow<T>

Creates a change stream for this database.

Return

the change stream iterable

Parameters

T

the target document type of the iterable.

pipeline

the aggregation pipeline to apply to the change stream, defaults to an empty pipeline.

See also

Change Streams(https://dochub.mongodb.org/changestreams]


@JvmName(name = "watchAsDocumentWithSession")
fun watch(clientSession: ClientSession, pipeline: List<Bson> = emptyList()): ChangeStreamFlow<Document>

Creates a change stream for this database.

Return

the change stream iterable

Parameters

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline to apply to the change stream, defaults to an empty pipeline.

See also

Change Streams(https://dochub.mongodb.org/changestreams]


inline fun <T : Any> watch(clientSession: ClientSession, pipeline: List<Bson> = emptyList()): ChangeStreamFlow<T>

Creates a change stream for this database.

Return

the change stream iterable

Parameters

T

the target document type of the iterable.

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline to apply to the change stream, defaults to an empty pipeline.

See also

Change Streams(https://dochub.mongodb.org/changestreams]


fun <T : Any> watch(pipeline: List<Bson> = emptyList(), resultClass: Class<T>): ChangeStreamFlow<T>

Creates a change stream for this database.

Return

the change stream iterable

Parameters

T

the target document type of the iterable.

pipeline

the aggregation pipeline to apply to the change stream, defaults to an empty pipeline.

resultClass

the target document type of the iterable.

See also

Change Streams(https://dochub.mongodb.org/changestreams]


fun <T : Any> watch(clientSession: ClientSession, pipeline: List<Bson> = emptyList(), resultClass: Class<T>): ChangeStreamFlow<T>

Creates a change stream for this database.

Return

the change stream iterable

Parameters

T

the target document type of the iterable.

clientSession

the client session with which to associate this operation

pipeline

the aggregation pipeline to apply to the change stream, defaults to an empty pipeline.

resultClass

the target document type of the iterable.

See also

Change Streams(https://dochub.mongodb.org/changestreams]