File tree Expand file tree Collapse file tree 4 files changed +50
-2
lines changed
Expand file tree Collapse file tree 4 files changed +50
-2
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
33
4- Changes in Version 4.11.0 (YYYY/MM/DD)
4+ Changes in Version 4.11.2 (YYYY/MM/DD)
5+ --------------------------------------
6+
7+ Version 4.11.1 is a bug fix release.
8+
9+ - Fixed a bug where :meth: `~pymongo.database.Database.command ` would fail when attempting to run the bulkWrite command.
10+
11+ Issues Resolved
12+ ...............
13+
14+ See the `PyMongo 4.11.2 release notes in JIRA `_ for the list of resolved issues
15+ in this release.
16+
17+ .. _PyMongo 4.11.2 release notes in JIRA : https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=42506
18+
19+ Changes in Version 4.11.1 (2025/02/10)
20+ --------------------------------------
21+
22+ - Fixed support for prebuilt ``ppc64le `` and ``s390x `` wheels.
23+
24+ Changes in Version 4.11.0 (2025/01/28)
525--------------------------------------
626
727.. warning :: PyMongo 4.11 drops support for Python 3.8 and PyPy 3.9: Python 3.9+ or PyPy 3.10+ is now required.
Original file line number Diff line number Diff line change 105105 "insert" : "documents" ,
106106 "update" : "updates" ,
107107 "delete" : "deletes" ,
108- "bulkWrite" : "bulkWrite " ,
108+ "bulkWrite" : "ops " ,
109109}
110110
111111_UNICODE_REPLACE_CODEC_OPTIONS : CodecOptions [Mapping [str , Any ]] = CodecOptions (
Original file line number Diff line number Diff line change @@ -430,6 +430,20 @@ async def test_command_with_regex(self):
430430 for doc in result ["cursor" ]["firstBatch" ]:
431431 self .assertTrue (isinstance (doc ["r" ], Regex ))
432432
433+ async def test_command_bulkWrite (self ):
434+ # Ensure bulk write commands can be run directly via db.command().
435+ await self .client .admin .command (
436+ {
437+ "bulkWrite" : 1 ,
438+ "nsInfo" : [{"ns" : self .db .test .full_name }],
439+ "ops" : [{"insert" : 0 , "document" : {}}],
440+ }
441+ )
442+ await self .db .command ({"insert" : "test" , "documents" : [{}]})
443+ await self .db .command ({"update" : "test" , "updates" : [{"q" : {}, "u" : {"$set" : {"x" : 1 }}}]})
444+ await self .db .command ({"delete" : "test" , "deletes" : [{"q" : {}, "limit" : 1 }]})
445+ await self .db .test .drop ()
446+
433447 async def test_cursor_command (self ):
434448 db = self .client .pymongo_test
435449 await db .test .drop ()
Original file line number Diff line number Diff line change @@ -425,6 +425,20 @@ def test_command_with_regex(self):
425425 for doc in result ["cursor" ]["firstBatch" ]:
426426 self .assertTrue (isinstance (doc ["r" ], Regex ))
427427
428+ def test_command_bulkWrite (self ):
429+ # Ensure bulk write commands can be run directly via db.command().
430+ self .client .admin .command (
431+ {
432+ "bulkWrite" : 1 ,
433+ "nsInfo" : [{"ns" : self .db .test .full_name }],
434+ "ops" : [{"insert" : 0 , "document" : {}}],
435+ }
436+ )
437+ self .db .command ({"insert" : "test" , "documents" : [{}]})
438+ self .db .command ({"update" : "test" , "updates" : [{"q" : {}, "u" : {"$set" : {"x" : 1 }}}]})
439+ self .db .command ({"delete" : "test" , "deletes" : [{"q" : {}, "limit" : 1 }]})
440+ self .db .test .drop ()
441+
428442 def test_cursor_command (self ):
429443 db = self .client .pymongo_test
430444 db .test .drop ()
You can’t perform that action at this time.
0 commit comments