getEntries method

Future<List<OpLogEntry<T>>> getEntries(
  1. String clientReferenceId,
  2. DataOperation operation
)

Implementation

Future<List<OpLogEntry<T>>> getEntries(
  String clientReferenceId,
  DataOperation operation,
) async {
  final oplog = await isar.opLogs
      .filter()
      .operationEqualTo(operation)
      .clientReferenceIdEqualTo(clientReferenceId)
      .findAll();

  if (oplog.isEmpty) {
    throw AppException('OpLog not found for id: $clientReferenceId');
  }

  return oplog.map((e) => OpLogEntry.fromOpLog<T>(e)).toList();
}