MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / set_read_write_concern

Function set_read_write_concern

mongoengine/context_managers.py:299–313  ·  view source on GitHub ↗
(collection, write_concerns, read_concerns)

Source from the content-addressed store, hash-verified

297
298@contextmanager
299def set_read_write_concern(collection, write_concerns, read_concerns):
300 combined_write_concerns = dict(collection.write_concern.document.items())
301
302 if write_concerns is not None:
303 combined_write_concerns.update(write_concerns)
304
305 combined_read_concerns = dict(collection.read_concern.document.items())
306
307 if read_concerns is not None:
308 combined_read_concerns.update(read_concerns)
309
310 yield collection.with_options(
311 write_concern=WriteConcern(**combined_write_concerns),
312 read_concern=ReadConcern(**combined_read_concerns),
313 )

Callers 2

updateMethod · 0.90

Calls 2

itemsMethod · 0.80
updateMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…