Skip to content

add support for comment on bulk_write - #915

Open
thiagosalvatore wants to merge 1 commit into
mongomock:developfrom
thiagosalvatore:develop
Open

thiagosalvatore wants to merge 1 commit into
mongomock:developfrom
thiagosalvatore:develop

Conversation

@thiagosalvatore

Copy link
Copy Markdown

I've been using mongomock together with mongomock-motor and beanie.

In recent versions of MongoDB support for comment has been added on bulk write operations.

However, if this parameter is sent to the current implementation of bulk_write, it breaks.

This PR basically accepts the parameter and logs a warning letting the user know that it is ignored on mongomock.

@codecov

codecov Bot commented Mar 7, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (d5c0e8b) to head (875209c).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #915   +/-   ##
========================================
  Coverage    96.07%   96.07%           
========================================
  Files           35       35           
  Lines        10118    10120    +2     
========================================
+ Hits          9721     9723    +2     
  Misses         397      397           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

engFelipeMonteiro added a commit to engFelipeMonteiro/mongomock-ng that referenced this pull request May 20, 2026
Add comment parameter to find(), find_one(), count_documents(),
estimated_document_count(), distinct(), bulk_write(), insert_one(),
delete_one(), and update_one() to match pymongo API.

Add hint parameter to find(), find_one(), count_documents(), and
distinct().

References: mongomock#921, mongomock#922, mongomock#915, mongomock#831
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.

1 participant