File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,23 @@ fun main() = runBlocking {
646
646
// End Changestream Example 3
647
647
648
648
// Start Changestream Example 4
649
+ val pipeline = listOf (
650
+ Aggregates .match(
651
+ or (
652
+ eq(" fullDocument.username" , " alice" ),
653
+ `in `(" operationType" , listOf (" delete" ))
654
+ )
655
+ ))
656
+
657
+ val job = launch {
658
+ val changeStream = collection.watch(pipeline)
659
+ changeStream.collect {
660
+ println (" Received a change event: $it " )
661
+ }
662
+ }
663
+ // End Changestream Example 4
664
+
665
+ // Start Changestream Example 4 Alt
649
666
val pipeline = listOf (
650
667
Aggregates .match(Filters .`in `(" operationType" ,
651
668
listOf (" insert" , " update" )))
@@ -657,7 +674,7 @@ fun main() = runBlocking {
657
674
println (" Received a change event: $it " )
658
675
}
659
676
}
660
- // End Changestream Example 4
677
+ // End Changestream Example 4 Alt
661
678
662
679
// Start Stable API Example 1
663
680
val serverApi = ServerApi .builder()
You can’t perform that action at this time.
0 commit comments