diff --git a/motor/core.py b/motor/core.py index 1da4c308..9ecf1807 100644 --- a/motor/core.py +++ b/motor/core.py @@ -110,6 +110,7 @@ class AgnosticClient(AgnosticBaseProperties): arbiters = ReadOnlyProperty() close = DelegateMethod() __hash__ = DelegateMethod() + bulk_write = AsyncRead() drop_database = AsyncCommand().unwrap("MotorDatabase") options = ReadOnlyProperty() get_database = DelegateMethod(doc=docstrings.get_database_doc).wrap(Database) diff --git a/motor/core.pyi b/motor/core.pyi index 554b5160..63d04d07 100644 --- a/motor/core.pyi +++ b/motor/core.pyi @@ -53,6 +53,7 @@ from pymongo.read_concern import ReadConcern from pymongo.read_preferences import _ServerMode from pymongo.results import ( BulkWriteResult, + ClientBulkWriteResult, DeleteResult, InsertManyResult, InsertOneResult, @@ -124,6 +125,17 @@ class AgnosticClient(AgnosticBaseProperties[_DocumentType]): write_concern: Optional[WriteConcern] = None, read_concern: Optional[ReadConcern] = None, ) -> AgnosticDatabase[_DocumentType]: ... + async def bulk_write( + self, + models: Sequence[_WriteOp[_DocumentType]], + session: Optional[ClientSession] = None, + ordered: bool = True, + verbose_results: bool = False, + bypass_document_validation: Optional[bool] = None, + comment: Optional[Any] = None, + let: Optional[Mapping] = None, + write_concern: Optional[WriteConcern] = None, + ) -> ClientBulkWriteResult: ... HOST: str diff --git a/synchro/__init__.py b/synchro/__init__.py index b66c9667..d58c16f0 100644 --- a/synchro/__init__.py +++ b/synchro/__init__.py @@ -103,6 +103,7 @@ from pymongo.srv_resolver import _resolve, _SrvResolver from pymongo.ssl_support import * from pymongo.synchronous.client_session import _TxnState +from pymongo.synchronous.encryption import _Encrypter from pymongo.synchronous.monitor import * from pymongo.synchronous.periodic_executor import * from pymongo.synchronous.periodic_executor import _EXECUTORS diff --git a/test/tornado_tests/test_motor_core.py b/test/tornado_tests/test_motor_core.py index 71b137b8..72558189 100644 --- a/test/tornado_tests/test_motor_core.py +++ b/test/tornado_tests/test_motor_core.py @@ -33,7 +33,7 @@ def attrs(klass): motor_client_only = motor_only.union(["open"]) -pymongo_client_only = set(["bulk_write"]).union(pymongo_only) +pymongo_client_only = set([]).union(pymongo_only) pymongo_database_only = set([]).union(pymongo_only)