| 417 | self.assertIsInstance(doc["r"], Regex) |
| 418 | |
| 419 | def test_command_bulkWrite(self): |
| 420 | # Ensure bulk write commands can be run directly via db.command(). |
| 421 | if client_context.version.at_least(8, 0): |
| 422 | self.client.admin.command( |
| 423 | { |
| 424 | "bulkWrite": 1, |
| 425 | "nsInfo": [{"ns": self.db.test.full_name}], |
| 426 | "ops": [{"insert": 0, "document": {}}], |
| 427 | } |
| 428 | ) |
| 429 | self.db.command({"insert": "test", "documents": [{}]}) |
| 430 | self.db.command({"update": "test", "updates": [{"q": {}, "u": {"$set": {"x": 1}}}]}) |
| 431 | self.db.command({"delete": "test", "deletes": [{"q": {}, "limit": 1}]}) |
| 432 | self.db.test.drop() |
| 433 | |
| 434 | def test_cursor_command(self): |
| 435 | db = self.client.pymongo_test |