Questions tagged [realm]

Realm, formally known as MongoDB Realm, is an object-oriented database widely used as an alternative to SQLite & ORMs that includes a built-in device-to-cloud data sync. Realm supports a variety of platforms including Android, iOS, Linux, macOS, and Windows.

Realm formally known as MongoDB Realm, is an object-oriented database widely used as an alternative to CoreDate, SQLite & ORMs. Realm supports a variety of platforms including Android, iOS, Linux, macOS, and Windows.

Realm can be used as a local-only data store or synchronized to MongoDB’s multi-cloud database platform Atlas via a built-in, real-time device-to-cloud sync service – Realm Sync.

Originally released in 2016, Realm was acquired by MongoDB in 2019. It remains open source under the Apache License.

Useful Links

9370 questions
3
votes
0 answers

"foreign key" as primary key in realm

I'm getting started with realm and trying to figure out the best way to write my model layer, so after overthinking about it I decide to ask here to get some opinions. Here we go: I'm writing a realm version of these tables: Account id - String…
3
votes
1 answer

Running my most recent Realm migration hangs

So I added some new properties to some of my models, and in the simulator, simply calling this works: setSchemaVersion(7, realmPath: Realm.defaultPath) { migration, oldSchemaVersion in if oldSchemaVersion < 7 { …
Adam Singer
  • 2,377
  • 3
  • 18
  • 18
3
votes
1 answer

How to get parent object in Realm

Reference to realms doc I have some entities, for example it is: Category and Item. The Category contains RealmList of Items and I can access all items of category by calling getter of this list. But how can I query all items by category's id(it's…
uneven
  • 341
  • 2
  • 13
3
votes
1 answer

Realm data not saving java

I am trying to save data into a RealmListafter calling a dialog box. The dialog is supposed to take the name of the new object, a FixtureInfo, add it to the RealmList, and then move to the next activity. However after moving to the next activity and…
JJ Stamp
  • 121
  • 2
  • 13
3
votes
1 answer

Realm: Update/Set relationship without updating existing child object

Given the following data model, is there a way to update or set a child relationship without updating the (existing) child object? Data Model class Person: Object { dynamic var id = 0 dynamic var dog: Dog? override static func…
schickling
  • 4,000
  • 4
  • 29
  • 33
3
votes
2 answers

How to avoid import cycle if I need the protocols imported?

In objective-C i made 11 classes which subclass RLMObject to represent the model of my database. And as of now I have a problem building my App with this, because as stated in the title, they seem to not see each other. Additionally: they are in the…
dfinki
  • 324
  • 4
  • 13
3
votes
0 answers

io.realm.exceptions.RealmError: Unrecoverable error. mmap() failed: Out of memory in io_realm_internal_SharedGroup.cpp line 115

I have a chat application with history cached in Realm database wrapped at RxJava operators. Everything works fine but I sometimes catch this exception on a specific set of devices: io.realm.exceptions.RealmError: Unrecoverable error. mmap()…
3
votes
2 answers

Realm findAllSorted by field of a filed

Another question about realm. I have this structure; Class A has a class B which has a String name. I want to sort the list of Class A by B b that has a name "xy"; so this is how I tried but does not…
Ferenczi Jano
  • 89
  • 1
  • 1
  • 8
3
votes
1 answer

Realm model migration strategy

I have run into a problem working with Realm migration blocks and the strategy for migrating realms. Given an object MyObject with a number of properties: In version 1 we have the property myProperty In version 2 we change the property to…
3
votes
4 answers

java.lang.IllegalArgumentException: Category is not part of the schema for this Realm

I using Android Studio 1.2.2 and Realm 0.81.1. I have created a Model 'Category' as follows: @RealmClass public class Category extends RealmObject { private String name; // getter and setter } But I am getting …
Shivang Doshi
  • 245
  • 1
  • 8
  • 19
3
votes
2 answers

Sharing Realm fields on Android

Realm on Android doesn't support model inheritance/polymorphism. So is there any way to share fields on Android? We have 5 models that all share the same synchronization-related fields and code. We use inheritance in our current SQLite models; if we…
Nolan Amy
  • 10,785
  • 5
  • 34
  • 45
3
votes
1 answer

Open Realm Browser on Live Database in Genymotion?

I'd like to monitor a Realm database while running an Android app on Genymotion -- rather than pulling it over and over again. The most obvious possibilities would be to have the Realm database stored on external storage that's mounted to the local…
ZaBlanc
  • 4,679
  • 1
  • 35
  • 38
3
votes
2 answers

Parsing json to a string in Gson

I have a json string: { "id":123, "name":"", "details":{} } I want to parse to this object: class Student { int id; String name; String details; } This is the error that I get: java.lang.RuntimeException: Unable to start activity…
Jimmy
  • 10,427
  • 18
  • 67
  • 122
3
votes
2 answers

Realm or Paper for JPA in Android?

I'm developing an Android app with Android Annotations. For persistence, I firstly used a Content Provider (very complex) on top of SQLite. Then, I discovered Realm. It seemed very cool until I had to be notified for insertions to make my…
Louis CAD
  • 10,965
  • 2
  • 39
  • 58
3
votes
2 answers

Realm Swift : Update an object inside a closure

For the sake of the question, here's a simple example (with a few shortcuts) : class Foo: Object { dynamic var id: Int = 0 [...] } class Bar: Object { dynamic var id: Int = 0 dynamic var foo: Foo? convenience required init(data:…
Sylver
  • 2,285
  • 3
  • 29
  • 40
1 2 3
99
100