Skip to content

DOCSP-43420: Client bulk write #177

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 8 commits into from
Feb 24, 2025

Conversation

norareidy
Copy link
Collaborator

@norareidy norareidy commented Feb 18, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-43420

Staging Links

  • write/bulk-write
  • write/transactions
  • 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 Feb 18, 2025

    Deploy Preview for docs-pymongo ready!

    Name Link
    🔨 Latest commit ed392b0
    🔍 Latest deploy log https://app.netlify.com/sites/docs-pymongo/deploys/67bc9577102a710008c3ba2a
    😎 Deploy Preview https://deploy-preview-177--docs-pymongo.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.

    Copy link
    Collaborator

    @rachel-mack rachel-mack 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 things:

    Comment on lines 111 to 116
    - Namespace in which to perform the update. This argument is optional if
    you perform the bulk operation on a single collection.
    - **Query filter** that specifies the criteria used to match documents in your collection.
    - Update operation you want to perform. For more information about update
    operations, see the :manual:`Field Update Operators
    </reference/operator/update-field/>` guide in the {+mdb-server+} manual.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    You could do this or make this a table:

    Suggested change
    - Namespace in which to perform the update. This argument is optional if
    you perform the bulk operation on a single collection.
    - **Query filter** that specifies the criteria used to match documents in your collection.
    - Update operation you want to perform. For more information about update
    operations, see the :manual:`Field Update Operators
    </reference/operator/update-field/>` guide in the {+mdb-server+} manual.
    - Namespace: Where to perform the update. This argument is optional if
    you perform the bulk operation on a single collection.
    - Query filter: Specifies the criteria used to match documents in your collection.
    - Update operation: The operation you want to perform. For more information about update
    operations, see the :manual:`Field Update Operators
    </reference/operator/update-field/>` guide in the {+mdb-server+} manual.

    Same of the proceeding operation parameters.

    Comment on lines +217 to +222
    When {+driver-short+} runs a bulk operation, it uses the ``write_concern`` of the
    collection or client on which the operation is running. You can also set
    a write concern for the operation when using the ``MongoClient.bulk_write()``
    method. The driver reports all write concern errors after attempting all operations,
    regardless of execution order.

    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Add link to Write Concern in the server manual

    Comment on lines 278 to 279
    operation. If you don't specify any additional options, the driver does not customize
    the bulk 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.

    I realize you didn't add this, but it's an odd thing to explicitly call out, so I think we should remove it.

    Suggested change
    operation. If you don't specify any additional options, the driver does not customize
    the bulk write operation.
    operation.

    Copy link

    @caseyclements caseyclements left a comment

    Choose a reason for hiding this comment

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

    One tiny suggestion.


    You can use bulk operations to perform multiple write operations on
    a collection. You can also call bulk operations on your client,
    which allows you to perform bulk writes across multiple namespaces.

    Choose a reason for hiding this comment

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

    I'd probably say, "Both collections and clients have bulk_write methods. Using the latter allows you to perform bulk writes across multiple namespaces."

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    I reworded, let me know what you think!

    Copy link

    @caseyclements caseyclements left a comment

    Choose a reason for hiding this comment

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

    LGTM!

    @norareidy norareidy merged commit 7609c5a into mongodb:master Feb 24, 2025
    6 checks passed
    @norareidy norareidy deleted the DOCSP-43420-client-bulk-write branch February 24, 2025 18:19
    norareidy added a commit that referenced this pull request Feb 24, 2025
    * DOCSP-43420: Client bulk write
    
    * versions
    
    * output
    
    * error type
    
    * wording
    
    * RM feedback
    
    * admonition
    
    * CC feedback
    
    (cherry picked from commit 7609c5a)
    norareidy added a commit that referenced this pull request Feb 24, 2025
    * DOCSP-43420: Client bulk write
    
    * versions
    
    * output
    
    * error type
    
    * wording
    
    * RM feedback
    
    * admonition
    
    * CC feedback
    
    (cherry picked from commit 7609c5a)
    norareidy added a commit that referenced this pull request Feb 24, 2025
    * DOCSP-43420: Client bulk write
    
    * versions
    
    * output
    
    * error type
    
    * wording
    
    * RM feedback
    
    * admonition
    
    * CC feedback
    
    (cherry picked from commit 7609c5a)
    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