(self)
| 407 | # We use 'aggregate' as our example command, since it's an easy way to |
| 408 | # retrieve a BSON regex from a collection using a command. |
| 409 | def test_command_with_regex(self): |
| 410 | db = self.client.pymongo_test |
| 411 | db.test.drop() |
| 412 | db.test.insert_one({"r": re.compile(".*")}) |
| 413 | db.test.insert_one({"r": Regex(".*")}) |
| 414 | |
| 415 | result = db.command("aggregate", "test", pipeline=[], cursor={}) |
| 416 | for doc in result["cursor"]["firstBatch"]: |
| 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(). |
nothing calls this directly
no test coverage detected