document method

DocumentReference document([
  1. String? name
])

Returns a DocumentReference with the provided name in this collection.

If no name is provided, an auto-generated name is used.

Implementation

DocumentReference document([String? name]) {
  String documentPath;
  if (name == null) {
    final key = PushIdGenerator.generatePushChildName();
    documentPath = '$path/$key';
  } else {
    documentPath = '$path/$name';
  }

  return DocumentReference._path(
      service as CarpService, studyId, documentPath);
}