remove method

Future<Map<String, dynamic>> remove(
  1. String documentHandle,
  2. {String rev,
  3. bool waitForSync,
  4. bool overwrite,
  5. bool returnOld,
  6. bool silent}
)

Implementation

Future<Map<String, dynamic>> remove(
  String documentHandle, {
  String rev,
  bool waitForSync,
  bool overwrite,
  bool returnOld,
  bool silent,
}) async {
  final headers = <String, String>{};
  if (rev != null && _connection.arangoMajor >= 3) {
    headers['if-match'] = rev;
  }

  final queries = <String, String>{};
  if (waitForSync == true) queries['waitForSync'] = 'true';
  if (overwrite == true) queries['silent'] = 'true';
  if (returnOld == true) queries['returnNew'] = 'true';
  if (silent == true) queries['returnOld'] = 'true';

  final resp = await _connection.request(
    method: 'DELETE',
    path: '/_api/${_documentPath(documentHandle)}',
    queries: queries,
    headers: headers,
  );

  return resp.body;
}