path property

String path

A string representing the path of the referenced document (relative to the root of the database).

final collectionRef = firestore.collection('col');

collectionRef.add({'foo': 'bar'}).then((documentReference) {
  print('Added document at "${documentReference.path}"');
});

Implementation

String get path => _path.relativeName;