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