code: def persist(self, context):
  		
  		
  		D = self._Document
  		document = context.session[self.name]
  		
  		D.get_collection().replace_one(D.id == document.id, document, True)
docs: Update or insert the session document into the configured collection