View Your Data

3
Last updated 3 months ago

Local Realms

Realm Studio allows you to open up a local Realm file and view the data. Once opened, you can edit the data and it will save changes into the Realm.

If you are working with Realm files on a device, you will need to transfer them onto your machine.

Click "Open Realm file" to bring up the file window
View and edit local Realm files - a demo file is available to try it out!

Viewing realms from emulators

Studio allows you to live observe (and edit) any local realm, which can be very useful when developing mobile apps and testing them in the emulator. Since the emulator is running locally you can open the realm(s) and observe them in realtime as you are debugging your app. The only problem is that emulators in general make it really hard to find out where they are storing their local files.

Fortunately there is a way to find out where any given realm is located. You can get the on-disk storage location from the configuration, dump it to the debug console, and then use that path to open the Realm in Studio:

Swift
JavaScript
Java
.NET
// Get on-disk location of the default Realm
let realm = try! Realm()
print("Realm is located at:", realm.configuration.fileURL!)
// Get on-disk location of the default Realm
Realm.open({}).then(realm => {
console.log("Realm is located at: " + realm.path);
});

The filesystem used by Android emulators are unfortunately not directly accessible from the machine running Realm Studio. In this case you need to download the file from the emulator before it can be accessed.

// Run this on the device to find the path on the emulator
Realm realm = Realm.getDefaultInstance();
Log.i("Realm", realm.getPath());

Then download the file using ADB. This can be done while the app is running.

> adb pull <path>

You can also upload the modified file again using ADB, but only do this while the app is not running as it otherwise can corrupt the file.

> adb push <file> <path>
var realm = Realm.GetInstance();
Console.WriteLine($"Realm is located at: {realm.Config.DatabasePath}");

Importing Data

Realm Studio supports the ability to create a Realm file from CSV. To do so, go to File then Create Realm from --> CSV.

Note that when importing from CSV, the first row will be used as the object properties.

For example, a CSV formatted like:

data.csv
device,number,flag
gizmo,1,TRUE
widget,2,FALSE

This will result in a model named datathat has three properties: device which will be a string, number which will be an int and flag which will be a bool

Server Realms

Realm Studio allows you to connect to a Realm Object Server, including Self-Hosted or Cloud instances. Once connected you can browser all of the synchronized Realms on the server and open them to view the data. Any changes you make to the data while viewing, will be automatically synchronized to any other devices sharing the data.

Realms

Once you have logged into your server, you will be able to see a list of the available Realms:

View the list of Realms in your server

You can create a new synchronized Realm. This is useful when you are creating a shared Realm that will be access by many users.

View your data

Edit Schema

With synchronized Realms, you can make changes to the schema. This is limited to additive changes only: creating new models and properties.

__ Models

When using query-based synchronization, you'll notice that a number of special models are created inside of your Realm. They are prefaced with "__" and are used for implementation purposes. These models are as follows:

  • __Class

  • __DefaultRealmVersion

  • __Permission

  • __Realm

  • __Role

  • __User

Not what you were looking for? Leave Feedback