View Your Data

3
Last updated last month

Local Realms

Realm Studio allows you to open local Realm files and view the data. Once opened, you can edit data and save changes to 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 Realm local to it. This can be useful very useful during mobile app development, since you can run an emulator on the same machine as Realm Studio and observe Realms in real time while debugging your app. The only challenge is that emulators often make it really hard to find their local files.

Fortunately you can get the on-disk storage location from the Realm 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, either Self-Hosted or Cloud-based. Once connected you can browse to all of the synchronized Realms on the server and open them to view the data. Any changes you make to the data 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 new synchronized Realms through Studio. This is useful when you are creating a shared Realm that will be accessed by many users.

View your data

Edit Schema

You can also use Studio to make changes to synchronized Realm schemas. This is limited to additive changes: 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