deleteDocument method

Future<void> deleteDocument(
  1. LocalStoreDocumentQuery query
)

Implementation

Future<void> deleteDocument(LocalStoreDocumentQuery query) async {
  await initialize();
  final trimPath = query.path.trimQuery().trimString("/");
  final paths = trimPath.split("/");
  if (paths.isEmpty) {
    return;
  }
  _data._deleteFromPath(paths, 0);
  notifyDocuments(
    trimPath,
    paths.last,
    {},
    LocalStoreDocumentUpdateStatus.deleted,
    query,
  );
  await onDeleted?.call();
}