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

Method to_mongo

mongoengine/document.py:111–118  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

109 self._instance = state["_instance"]
110
111 def to_mongo(self, *args, **kwargs):
112 data = super().to_mongo(*args, **kwargs)
113
114 # remove _id from the SON if it's in it and it's None
115 if "_id" in data and data["_id"] is None:
116 del data["_id"]
117
118 return data
119
120
121class Document(BaseDocument, metaclass=TopLevelDocumentMetaclass):

Callers

nothing calls this directly

Calls 1

to_mongoMethod · 0.45

Tested by

no test coverage detected