Skip to content
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-43071: Bulk operations #54

Merged
merged 8 commits into from
Oct 1, 2024

Conversation

norareidy
Copy link
Collaborator

@norareidy norareidy commented Sep 27, 2024

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-43071
Staging - https://deploy-preview-54--docs-c.netlify.app/write/bulk-write/

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?
  • Are the facets and meta keywords accurate?

Copy link

netlify bot commented Sep 27, 2024

Deploy Preview for docs-c ready!

Name Link
🔨 Latest commit cde9ec1
🔍 Latest deploy log https://app.netlify.com/sites/docs-c/deploys/66fc20ef2cb6e60008253c89
😎 Deploy Preview https://deploy-preview-54--docs-c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +281 to +282
- :ref:`c-write-delete`
- :ref:`c-write-replace`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewer: these links will be broken until #52 and #53 are merged

@stephmarie17 stephmarie17 self-requested a review September 27, 2024 20:48
Copy link
Collaborator

@stephmarie17 stephmarie17 left a comment

Choose a reason for hiding this comment

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

LGTM with a few suggestions!

Comment on lines 51 to 52
- Collection: Specifies the collection to modify
- Options document: Specifies options to customize the operation, or ``NULL``
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Collection: Specifies the collection to modify
- Options document: Specifies options to customize the operation, or ``NULL``
- **Collection**: Specifies the collection to modify
- **Options document**: Specifies options to customize the operation, or ``NULL``

To run each write operation queued in the bulk write, call the ``mongoc_bulk_operation_execute()``
function. This function accepts the following parameters:

- ``mongoc_bulk_operation_t`` value: Contains the instructions for each write operation
Copy link
Collaborator

Choose a reason for hiding this comment

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

[s] Can also bold these terms per the style guide

source/write/bulk-write.txt Show resolved Hide resolved
@@ -57,6 +57,8 @@ Each update function accepts the following parameters:
and their usage, see the :manual:`Field Update Operators guide
</reference/operator/update-field/>` in the {+mdb-server+} manual.

- Options document: Specifies options to customize the operation, or ``NULL``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[s] This list isn't fully from the diff, but I think the guidance around bolding terms would apply her as well.

@norareidy norareidy requested a review from kevinAlbs September 30, 2024 13:47
"restaurant_id", BCON_UTF8 ("1234")
);

mongoc_bulk_operation_insert_with_opts (bulk, insert_doc, NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add an out-parameter for a bson_error_t. Suggest checking the return:

bson_error_t error;
if (!mongoc_bulk_operation_insert_with_opts (bulk, insert_doc, NULL, &error)) {
    fprintf (stderr, "error adding insert operation: %s\n", error.message);
}

Suggestion also applies to other mongoc_bulk_operation_*_with_opts calls.

@norareidy norareidy requested a review from kevinAlbs September 30, 2024 18:32
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with one fix.

Comment on lines 212 to 213
If any of the write operations fail, the {+driver-short+} raises a
``mongoc_bulkwriteexception_t`` error and does not perform any further operations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove mention of mongoc_bulkwriteexception_t. mongoc_bulkwriteexception_t applies to the mongoc_bulkwrite_t. mongoc_bulkwrite_t requires server 8.0. mongoc_bulk_operation_t can be used with any supported server version.

Suggested change
If any of the write operations fail, the {+driver-short+} raises a
``mongoc_bulkwriteexception_t`` error and does not perform any further operations.
If any of the write operations fail, the {+driver-short+} sets the output error and does not perform any further operations.

@norareidy norareidy merged commit 50d5fd3 into mongodb:standardization Oct 1, 2024
5 checks passed
@norareidy norareidy deleted the DOCSP-43071-bulk branch October 1, 2024 16:26
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.

3 participants