code: def get_parent_id(self, resource, document):
          
          parent_type = self._get_parent_type(resource)
          if parent_type and document:
              return document.get(parent_type.get('field'))
  
          return None
docs: Get the Parent Id of the document
  
          :param resource: resource name
          :param document: document containing the parent id