Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Realm for React-native. reset database

I'am new in realm with react-native.

I change schema often, but get migration error everytime I change.

How do I reset realm database when I change schema?

like image 281
ChangJoo Park Avatar asked Feb 25 '16 22:02

ChangJoo Park


Video Answer


2 Answers

You can just delete the app from the device or the simulator to reset the Realm.

like image 101
bcamur Avatar answered Oct 19 '22 13:10

bcamur


Using Android Emulator Genymotion

In your app

const realm = await getRealm();
console.log(realm.path);

copy the result from console.log () which will be the path of your .realm file.

In (Cmd or Terminal)

adb shell rm /data/data/com.example.package/files/default.realm
like image 21
Andersonfrfilho Avatar answered Oct 19 '22 11:10

Andersonfrfilho