Skip to content

Commit d1557b7

Browse files
committed
Address RR feedback
1 parent 81e1af5 commit d1557b7

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

source/read/change-streams.txt

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Monitor Data Changes
2020
Overview
2121
--------
2222

23-
In this guide, you can learn how to use a **change stream** to monitor real-time
24-
changes to your database. A change stream is a {+mdb-server+} feature that
25-
allows your application to subscribe to data changes on a collection, database,
26-
or deployment.
23+
In this guide, you can learn how to use the {+driver-short+} to monitor a **change stream**,
24+
allowing you to view real-time changes to your database. A change stream is a {+mdb-server+} feature that
25+
publishes data changes on a collection, database, or deployment. Your application can
26+
subscribe to a change stream and use events to perform other actions.
2727

2828
Sample Data
2929
~~~~~~~~~~~
@@ -46,13 +46,16 @@ Open a Change Stream
4646

4747
To open a change stream, call the ``watch()`` method. The instance on which you
4848
call the ``watch()`` method on determines the scope of events that the change
49-
stream listens for. You can call the ``watch()`` method on the following
49+
stream listens for. You can call the ``watch()`` method on instances of the following
5050
classes:
5151

5252
- ``MongoClient``: To monitor all changes in the MongoDB deployment
5353
- ``MongoDatabase``: To monitor changes in all collections in the database
5454
- ``MongoCollection``: To monitor changes in the collection
5555

56+
Open a Change Stream Example
57+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58+
5659
The following example opens a change stream on the ``restaurants`` collection
5760
and prints changes as they occur:
5861

@@ -64,8 +67,8 @@ and prints changes as they occur:
6467
:dedent:
6568

6669
To begin watching for changes, run the application. Then, in a separate
67-
application or shell, modify the ``restaurants`` collection. The following
68-
example updates a document with a ``name`` field value of ``Blarney Castle``:
70+
application or shell, perform a write operation on the ``restaurants`` collection. The
71+
following example updates a document in which the value of the ``name`` is ``"Blarney Castle"``:
6972

7073
.. _kotlin-sync-change-stream-update:
7174

@@ -113,7 +116,7 @@ Modify the Change Stream Output
113116

114117
You can pass the ``pipeline`` parameter to the ``watch()`` method to modify the
115118
change stream output. This parameter allows you to watch for only specified
116-
change events. Format the parameter as a list of objects that each represent an
119+
change events. Format the parameter as a list of objects that each represents an
117120
aggregation stage.
118121

119122
You can specify the following stages in the ``pipeline`` parameter:
@@ -127,6 +130,9 @@ You can specify the following stages in the ``pipeline`` parameter:
127130
- ``$set``
128131
- ``$unset``
129132

133+
Open a Change Stream with a Pipeline Example
134+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135+
130136
The following example uses the ``pipeline`` parameter to open a change stream
131137
that records only update operations:
132138

@@ -142,10 +148,10 @@ To learn more about modifying your change stream output, see the
142148
</changeStreams/#modify-change-stream-output>` section in the {+mdb-server+}
143149
manual.
144150

145-
Modify ``watch()`` Behavior
146-
---------------------------
151+
Modify watch() Behavior
152+
-----------------------
147153

148-
The ``watch()`` method can be modified by chaining methods to the ``ChangeStreamIterable``
154+
You can modify the ``watch()`` by chaining methods to the ``ChangeStreamIterable``
149155
object returned by the ``watch()`` method call. If you don't specify any options, the
150156
driver does not customize the operation.
151157

@@ -186,7 +192,7 @@ of ``watch()``:
186192
milliseconds.
187193

188194
* - ``toCollection()``
189-
- | Appends all elements to the given destination collection.
195+
- | Inserts all elements into the given destination collection.
190196

191197
For a complete list of methods you can use to configure the ``watch()`` method, see
192198
the `ChangeStreamIterable <{+api+}/com.mongodb.kotlin.client/-change-stream-iterable/index.html>`__

0 commit comments

Comments
 (0)