exists property

Future<bool> get exists

Check if a document exists.

Implementation

Future<bool> get exists async {
  try {
    await get();
    return true;
  } on GrpcError catch (e) {
    if (e.code == StatusCode.notFound) {
      return false;
    } else {
      rethrow;
    }
  }
}