Skip to content

DOCSP-31089: Improve bulk operation examples #438

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
merged 6 commits into from
Sep 13, 2023

Conversation

norareidy
Copy link
Contributor

@norareidy norareidy commented Sep 12, 2023

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-31089
Staging - https://docs-mongodbcom-staging.corp.mongodb.com/java/docsworker-xlarge/DOCSP-31089-fix-bulk-examples/fundamentals/crud/write-operations/bulk/

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?

Copy link
Contributor

@mongoKart mongoKart left a comment

Choose a reason for hiding this comment

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

a couple suggestions but lgtm otherwise. nice job.

Comment on lines 218 to 219
a second parameter to specify the execution of the bulk operations as
ordered or unordered.
Copy link
Contributor

Choose a reason for hiding this comment

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

S:

Suggested change
a second parameter to specify the execution of the bulk operations as
ordered or unordered.
a second parameter to specify whether the execution of the bulk operations is
ordered or unordered.

Comment on lines 233 to 239
- An insert operation for a document where the ``name`` is ``"Zaynab Omar"`` and the
``age`` is ``37``
- A replace operation for a document where the ``_id`` is ``1`` with a new document
that contains the ``location`` field
- An update operation for a document where the ``name`` is ``"Zaynab Omar"`` to change the ``name``
field to ``"Zaynab Hassan"``
- A delete operation for all documents that have an ``age`` value greater than ``50``
Copy link
Contributor

Choose a reason for hiding this comment

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

S: suggestion for clarity/syntax (didn't include it here, but also a good idea to specify which document changing instead of just "a document"--e.g., "updates the first matching document...")

Suggested change
- An insert operation for a document where the ``name`` is ``"Zaynab Omar"`` and the
``age`` is ``37``
- A replace operation for a document where the ``_id`` is ``1`` with a new document
that contains the ``location`` field
- An update operation for a document where the ``name`` is ``"Zaynab Omar"`` to change the ``name``
field to ``"Zaynab Hassan"``
- A delete operation for all documents that have an ``age`` value greater than ``50``
- An operation that inserts a document where the ``name`` is ``"Zaynab Omar"`` and the
``age`` is ``37``
- An operation that replaces the document where the ``_id`` is ``1`` with a new document
that contains the ``location`` field
- An operation that updates a document where the ``name`` is ``"Zaynab Omar"`` to change the ``name``
field to ``"Zaynab Hassan"``
- An operation that deletes all documents where the ``age`` value is greater than ``50``

Comment on lines +123 to +126
bulkOperations.add(insertDoc);
bulkOperations.add(replaceDoc);
bulkOperations.add(updateDoc);
bulkOperations.add(deleteDoc);
Copy link
Contributor

Choose a reason for hiding this comment

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

good change here!

@norareidy norareidy merged commit ac436b5 into mongodb:master Sep 13, 2023
@norareidy norareidy deleted the DOCSP-31089-fix-bulk-examples branch September 13, 2023 17:39
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