Skip to content

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

Merged

Conversation

rustagir
Copy link
Contributor

Pull Request Info

PR Reviewing Guidelines

JIRA - DOCSP-22867
Staging

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working? NO LINKS

Copy link
Contributor

@DBirtolo-mdb DBirtolo-mdb left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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!

Comment on lines 92 to 95
``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.
Copy link
Contributor

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:

Suggested change
``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.

@rustagir rustagir requested a review from DBirtolo-mdb May 23, 2023 20:50
Copy link
Contributor

@DBirtolo-mdb DBirtolo-mdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rustagir rustagir merged commit a36b84c into mongodb:master May 23, 2023
rustagir added a commit that referenced this pull request May 24, 2023
* DOCSP-22867: describe changestreamdocument

* first pass fixes

* DB PR fixes 1

(cherry picked from commit a36b84c)
rustagir added a commit that referenced this pull request May 24, 2023
* DOCSP-22867: describe changestreamdocument

* first pass fixes

* DB PR fixes 1

(cherry picked from commit a36b84c)
rustagir added a commit that referenced this pull request May 24, 2023
* DOCSP-22867: describe changestreamdocument

* first pass fixes

* DB PR fixes 1

(cherry picked from commit a36b84c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants