code: def transform_outgoing(self, son, collection):
          
          if isinstance(son, dict):
              for (key, value) in son.items():
                  if self.replacement in key:
                      k = self.revert_key(key)
                      son[k] = self.transform_outgoing(son.pop(key), collection)
                  elif isinstance(value, dict):  # recurse into sub-docs
                      son[key] = self.transform_outgoing(value, collection)
                  elif isinstance(value, list):
                      son[key] = [self.transform_outgoing(item, collection)
                                  for item in value]
              return son
          elif isinstance(son, list):
              return [self.transform_outgoing(item, collection)
                      for item in son]
          else:
              return son
docs: Recursively restore all transformed keys.