-
Notifications
You must be signed in to change notification settings - Fork 43
DOCSP-22867: describe ChangeStreamDocument #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSP-22867: describe ChangeStreamDocument #406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. A couple of small things that occurred to me but only one approval-blocking suggestion.
change stream events whenever the data in the collection changes: | ||
The following code example shows how to open a change stream on a | ||
collection and print change stream events whenever the data in the | ||
collection changes: | ||
|
||
.. literalinclude:: /includes/fundamentals/code-snippets/change-streams/ChangeStreams.java | ||
:language: java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question]
This might be beyond the scope of this ticket, but when I was reading the example, I was wondering if it would be useful to show the definition of collection
? Right now, we have this comment:
// The collection variable references a MongoCollection instance
I leave this up to your judgment, but wanted to share the thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way the code is set up right now, a collection is passed as a parameter. I'm going to edit this to instantiate the collection inside the function though.
@@ -85,6 +86,14 @@ following text: | |||
... | |||
} | |||
|
|||
.. note:: ChangeStreamIterable and ChangeStreamDocument Types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question]
Does this qualify as being a note, or should it be introduced in normal text? if you remove the note style, you'd need to change the introduction. I just know that per the style guide, we are supposed to use notes and admonitions sparingly. This feels to me like it might be more appropriate to have in normal text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - but what do you mean about changing the introduction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - I just meant the wording would need to be reworked. It's all good!
``ChangeStreamIterable``. In the preceding example, the driver stored | ||
individual change stream events as ``ChangeStreamDocument`` objects, | ||
since we specified that the driver should populate the ``ChangeStreamIterable`` | ||
with ``Document`` types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion]
A couple of things here. First, the sentence is a little long, so I would recommend breaking it up. Also, I would put the action that we did first, to put the focus on that, and then have the effect later. Something like the following:
``ChangeStreamIterable``. In the preceding example, the driver stored | |
individual change stream events as ``ChangeStreamDocument`` objects, | |
since we specified that the driver should populate the ``ChangeStreamIterable`` | |
with ``Document`` types. | |
``ChangeStreamIterable``. In the preceding example, we specified the driver should | |
populate the ``ChangeStreamIterable`` with ``Document`` types. As a result, the driver | |
stores the individual change stream events as ``ChangeStreamDocument`` objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* DOCSP-22867: describe changestreamdocument * first pass fixes * DB PR fixes 1 (cherry picked from commit a36b84c)
* DOCSP-22867: describe changestreamdocument * first pass fixes * DB PR fixes 1 (cherry picked from commit a36b84c)
* DOCSP-22867: describe changestreamdocument * first pass fixes * DB PR fixes 1 (cherry picked from commit a36b84c)
Pull Request Info
PR Reviewing Guidelines
JIRA - DOCSP-22867
Staging
Self-Review Checklist