Is it possible to delete the realm table?

Asked 2 years ago, Updated 2 years ago, 110 views

I understand that you need to add classes to increase tables in Realm and increase or decrease properties in the class to increase or decrease items, but I don't know how to delete the tables.

I thought it would be reflected in Realm if I deleted the class and upgraded the version, but it doesn't seem to be reflected, so could you tell me how to delete the table from Realm?

realm

2022-09-30 19:48

1 Answers

If you delete the class from the project, the data remains intact.
Realm detects adding new classes or updating existing classes, but does nothing about missing classes.

Also, the concept of tables exists in Realm, but the action of deleting them by table is not disclosed.

The equivalent is achieved by deleting all data in that class (=table).

try realm.write{
    realm.delete(realm.objects(TheTable.self))
}

appears in


2022-09-30 19:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.