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

Method _get_update_doc

mongoengine/document.py:519–532  ·  view source on GitHub ↗

Return a dict containing all the $set and $unset operations that should be sent to MongoDB based on the changes made to this Document.

(self)

Source from the content-addressed store, hash-verified

517 return object_id
518
519 def _get_update_doc(self):
520 """Return a dict containing all the $set and $unset operations
521 that should be sent to MongoDB based on the changes made to this
522 Document.
523 """
524 updates, removals = self._delta()
525
526 update_doc = {}
527 if updates:
528 update_doc["$set"] = updates
529 if removals:
530 update_doc["$unset"] = removals
531
532 return update_doc
533
534 def _integrate_shard_key(self, doc, select_dict):
535 """Integrates the collection's shard key to the `select_dict`, which will be used for the query.

Callers 1

_save_updateMethod · 0.95

Calls 1

_deltaMethod · 0.80

Tested by

no test coverage detected