exists<T extends Model> static method

Future<bool> exists<T extends Model>({
  1. required dynamic id,
})

Checks if record with id (UUID) exists.

Implementation

static Future<bool> exists<T extends Model>({required dynamic id}) async {
  try {
    final records = await jsonIndex<T>();
    return records.any((r) => r['uuid'] == id);
  } catch (e) {
    return false;
  }
}