write_concern – Tools for specifying write concern (original) (raw)

Back to top

View this page

Toggle table of contents sidebar

Tools for working with write concerns.

See also

This module is compatible with both the synchronous and asynchronous PyMongo APIs.

class pymongo.write_concern.WriteConcern(w=None, wtimeout=None, j=None, fsync=None)

Parameters:

Changed in version 4.7: Deprecated parameter wtimeout, use timeout().

property acknowledged_: bool_

If True write operations will wait for acknowledgement before returning.

property document_: dict[str, Any]_

The document representation of this write concern.

Note

WriteConcern is immutable. Mutating the value ofdocument does not mutate this WriteConcern.

property is_server_default_: bool_

Does this WriteConcern match the server default.

pymongo.write_concern.validate_boolean(option, value)

Validates that ‘value’ is True or False.

Parameters:

Return type:

bool