code: @Nullable
    public DocumentReference getParent() {
      ResourcePath parent = path.getParent();
      return parent.isDocument() ? new DocumentReference(firestore, parent) : null;
    }
docs: Returns a DocumentReference to the containing Document if this is a subcollection, else null.
  
  @return A DocumentReference pointing to the parent document.