Commit 315f3cd 1 parent 736aa56 commit 315f3cd Copy full SHA for 315f3cd
File tree 4 files changed +46
-2
lines changed
4 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
- Changes in Version 4.11.1 (2025/MM/DD)
4
+ Changes in Version 4.11.2 (YYYY/MM/DD)
5
+ --------------------------------------
6
+
7
+ Version 4.11.2 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 in this release.
15
+
16
+ .. _PyMongo 4.11.2 release notes in JIRA : https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=42506
17
+
18
+ Changes in Version 4.11.1 (2025/02/10)
5
19
--------------------------------------
6
20
7
21
- Fixed support for prebuilt ``ppc64le `` and ``s390x `` wheels.
Original file line number Diff line number Diff line change 105
105
"insert" : "documents" ,
106
106
"update" : "updates" ,
107
107
"delete" : "deletes" ,
108
- "bulkWrite" : "bulkWrite " ,
108
+ "bulkWrite" : "ops " ,
109
109
}
110
110
111
111
_UNICODE_REPLACE_CODEC_OPTIONS : CodecOptions [Mapping [str , Any ]] = CodecOptions (
Original file line number Diff line number Diff line change @@ -430,6 +430,21 @@ async def test_command_with_regex(self):
430
430
for doc in result ["cursor" ]["firstBatch" ]:
431
431
self .assertTrue (isinstance (doc ["r" ], Regex ))
432
432
433
+ async def test_command_bulkWrite (self ):
434
+ # Ensure bulk write commands can be run directly via db.command().
435
+ if async_client_context .version .at_least (8 , 0 ):
436
+ await self .client .admin .command (
437
+ {
438
+ "bulkWrite" : 1 ,
439
+ "nsInfo" : [{"ns" : self .db .test .full_name }],
440
+ "ops" : [{"insert" : 0 , "document" : {}}],
441
+ }
442
+ )
443
+ await self .db .command ({"insert" : "test" , "documents" : [{}]})
444
+ await self .db .command ({"update" : "test" , "updates" : [{"q" : {}, "u" : {"$set" : {"x" : 1 }}}]})
445
+ await self .db .command ({"delete" : "test" , "deletes" : [{"q" : {}, "limit" : 1 }]})
446
+ await self .db .test .drop ()
447
+
433
448
async def test_cursor_command (self ):
434
449
db = self .client .pymongo_test
435
450
await db .test .drop ()
Original file line number Diff line number Diff line change @@ -425,6 +425,21 @@ def test_command_with_regex(self):
425
425
for doc in result ["cursor" ]["firstBatch" ]:
426
426
self .assertTrue (isinstance (doc ["r" ], Regex ))
427
427
428
+ def test_command_bulkWrite (self ):
429
+ # Ensure bulk write commands can be run directly via db.command().
430
+ if client_context .version .at_least (8 , 0 ):
431
+ self .client .admin .command (
432
+ {
433
+ "bulkWrite" : 1 ,
434
+ "nsInfo" : [{"ns" : self .db .test .full_name }],
435
+ "ops" : [{"insert" : 0 , "document" : {}}],
436
+ }
437
+ )
438
+ self .db .command ({"insert" : "test" , "documents" : [{}]})
439
+ self .db .command ({"update" : "test" , "updates" : [{"q" : {}, "u" : {"$set" : {"x" : 1 }}}]})
440
+ self .db .command ({"delete" : "test" , "deletes" : [{"q" : {}, "limit" : 1 }]})
441
+ self .db .test .drop ()
442
+
428
443
def test_cursor_command (self ):
429
444
db = self .client .pymongo_test
430
445
db .test .drop ()
You can’t perform that action at this time.
0 commit comments