parent property

The document that contains this collection, or null for a collection at the root of the database.

Implementation

DocumentReference<Map<String, Object?>>? get parent {
  final ResourcePath parentPath = query.path.popLast();
  if (parentPath.isEmpty) {
    return null;
  }
  return DocumentReference<Map<String, Object?>>(
    DocumentKey.fromPath(parentPath),
    firestore,
  );
}