|
def | __init__ (self, collection, ordered=True, bypass_document_validation=False) |
|
def | find (self, selector, collation=None) |
|
def | insert (self, document) |
|
def | execute (self, write_concern=None) |
|
**DEPRECATED**: An interface for executing a batch of write operations.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
collection, |
|
|
|
ordered = True , |
|
|
|
bypass_document_validation = False |
|
) |
| |
**DEPRECATED**: Initialize a new BulkOperationBuilder instance.
:Parameters:
- `collection`: A :class:`~pymongo.collection.Collection` instance.
- `ordered` (optional): If ``True`` all operations will be executed
serially, in the order provided, and the entire execution will
abort on the first error. If ``False`` operations will be executed
in arbitrary order (possibly in parallel on the server), reporting
any errors that occurred after attempting all operations. Defaults
to ``True``.
- `bypass_document_validation`: (optional) If ``True``, allows the
write to opt-out of document level validation. Default is
``False``.
.. note:: `bypass_document_validation` requires server version
**>= 3.2**
.. versionchanged:: 3.5
Deprecated. Use :meth:`~pymongo.collection.Collection.bulk_write`
instead.
.. versionchanged:: 3.2
Added bypass_document_validation support
◆ execute()
def execute |
( |
|
self, |
|
|
|
write_concern = None |
|
) |
| |
Execute all provided operations.
:Parameters:
- write_concern (optional): the write concern for this bulk
execution.
◆ find()
def find |
( |
|
self, |
|
|
|
selector, |
|
|
|
collation = None |
|
) |
| |
Specify selection criteria for bulk operations.
:Parameters:
- `selector` (dict): the selection criteria for update
and remove operations.
- `collation` (optional): An instance of
:class:`~pymongo.collation.Collation`. This option is only
supported on MongoDB 3.4 and above.
:Returns:
- A :class:`BulkWriteOperation` instance, used to add
update and remove operations to this bulk operation.
.. versionchanged:: 3.4
Added the `collation` option.
◆ insert()
def insert |
( |
|
self, |
|
|
|
document |
|
) |
| |
Insert a single document.
:Parameters:
- `document` (dict): the document to insert
.. seealso:: :ref:`writes-and-ids`
The documentation for this class was generated from the following file:
- /home/passerat/Stage/flaskProject/venv/lib/python3.8/site-packages/pymongo/bulk.py