documentExists method

Future<bool> documentExists(
  1. String documentHandle
)

Implementation

Future<bool> documentExists(String documentHandle) async {
  try {
    await _connection.request(
      method: 'HEAD',
      path: '/_api/${_documentPath(documentHandle)}',
    );
    return true;
  } on ArangoHttpError catch (e) {
    if (e.statusCode == 404) {
      return false;
    } else {
      rethrow;
    }
  }
}