deleteDocuments method
Delete a selection of documents by given query.
Implementation
Future<Task> deleteDocuments(DeleteDocumentsQuery query) async {
String route;
Object? data;
if (query.ids != null) {
// if ids are available, fallback to the delete-batch route
route = 'delete-batch';
data = query.ids;
} else {
// if ids are NOT available, use the new delete route
route = 'delete';
data = query.toSparseMap();
}
return await _getTask(
http.postMethod(
'/indexes/$uid/documents/$route',
data: data,
),
);
}