exists method

Future<bool> exists(
  1. String index,
  2. String collection,
  3. String id
)

Check if a document exists

Implementation

Future<bool> exists(String index, String collection, String id) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'exists',
    index: index,
    collection: collection,
    uid: id,
  ));

  if (response.result is bool) {
    return response.result as bool;
  }

  throw BadResponseFormatError(
      response.error?.id, '$name.exists: bad response format', response);
}