delete method

Future<DbResponse> delete({
  1. String? path,
  2. PrintMode? printMode,
  3. bool eTag = false,
  4. String? ifMatch,
})

Sends a delete requests to the database to delete some data.

Tries to delete the data at path, or the whole virtual root, if not set. The printMode can be used to control how data is formatted by the server.

Finally, the eTag parameter can be set to true to request an eTag for the given data. The resulting eTag should always be ApiConstants.nullETag. If you only want to be able to delete data if it was not changed, pass a previously acquired eTag as ifMatch. In case the eTag does not match, the request will fail with the ApiConstants.statusCodeETagMismatch status code.

Implementation

Future<DbResponse> delete({
  String? path,
  PrintMode? printMode,
  bool eTag = false,
  String? ifMatch,
}) async {
  final response = await client.delete(
    _buildUri(
      path: path,
      printMode: printMode,
    ),
    headers: _buildHeaders(
      eTag: eTag,
      ifMatch: ifMatch,
    ),
  );
  return _parseResponse(response, eTag);
}