mDelete method

Future<List<String>> mDelete(
  1. List<String> indexes
)

Deletes multiple indexes.

Implementation

Future<List<String>> mDelete(List<String> indexes) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'mDelete',
    body: <String, dynamic>{'indexes': indexes},
  ));

  final result = response.result as Map<String, dynamic>?;

  if (result != null && result.containsKey('deleted')) {
    if (result['deleted'] is List<dynamic>) {
      return List<String>.from(result['deleted'] as List<dynamic>);
    }
  }

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