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
22
votes
9 answers

Object is not part of the schema for this Realm

As soon as I try to get my object from Realm database, the app crashed and I get this error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.repdev.realtimedelijn/com.repdev.realtimedelijn.activity.MainActivity}: …
Riyan Fransen
  • 534
  • 1
  • 3
  • 14
22
votes
4 answers

Declare an array of Int in Realm Swift

How can I declare an array of integers inside RLMObject? Like : dynamic var key:[Int]? Gives the following error : Terminating app due to uncaught exception 'RLMException', reason: ''NSArray' is not supported as an RLMObject property. All…
Vinicius Albino
  • 743
  • 2
  • 8
  • 21
22
votes
10 answers

Realm Migration doesn't work

let config = Realm.Configuration( // Set the new schema version. This must be greater than the previously used // version (if you've never set a schema version before, the version is 0). schemaVersion: 1, // Set…
user2179936
  • 455
  • 2
  • 7
  • 16
21
votes
1 answer

What is the correct way to update swift version in Xcode/Cocoapods project?

I have an Xcode project, with cocoapods (RealmSwift) that was written in Swift 4.2. I have since updated Xcode to 10.2, and am now being prompted to convert my code (and the RealmSwift code) to Swift 5, and a load of warnings are being generated…
Lena Verhoev
  • 231
  • 1
  • 3
  • 15
21
votes
3 answers

Xamarin issues with Fody.WeavingTask and SolutionDir

I have been trying to use Realm in my Xamarin android proyect, one of it's dependencie is Fody, each time i try to run my app it shows the following error: error MSB4044: The "Fody.WeavingTask" task was not given a value for the required parameter…
keitaro martin
  • 837
  • 7
  • 7
21
votes
2 answers

How to organize React Native with Realm project files?

I've picked realm to store data in my React Native app. I don't understand, how to organize files in my project. Documentation provides only simple code for one component. But I need for different components different parts of database. I seen in…
acidernt
  • 2,173
  • 2
  • 19
  • 33
21
votes
2 answers

Realm Swift Models separate or not?

I'm new to the world of iOS and Swift and am working on a new app which I want to use Realm for persistence. I have Entities in my code already which my Services access and populate for an HTTP API endpoint. Now I want to persist certain Entities…
Rob212
  • 315
  • 2
  • 13
21
votes
3 answers

Realm migrations in Swift

I have a Realm Object modeled as so class WorkoutSet: Object { // Schema 0 dynamic var exerciseName: String = "" dynamic var reps: Int = 0 // Schema 0 + 1 dynamic var setCount: Int = 0 } I am trying to perform a…
Cody Weaver
  • 4,756
  • 11
  • 33
  • 51
21
votes
5 answers

Realm on Android - How to select multiple objects by list of ids (@PrimaryKey)?

I'm building an Android app with the Realm database. I have a RealmObject subclass called Article which has an id field (it's and int and also a @PrimaryKey). I would like to pass to a query a list of ints (a Set, int[], or whatever) of article id's…
Albert Vila Calvo
  • 15,298
  • 6
  • 62
  • 73
21
votes
2 answers

Should I define the primary key for each entity in Realm?

I have noticed that setting PK is not obligatory in Realm and simply can be omitted. But in documentation is stated that: Indexes are created automatically for primary key properties. And I'd like to clear up some questions: 1) What is the…
David
  • 1,061
  • 11
  • 18
21
votes
1 answer

List Or RealmList on Realm Android
I need a list using Realm. I tried RealmList but it doesn't work because RealmObject is abstract.
Bachlet Tansime
  • 1,273
  • 3
  • 12
  • 17
21
votes
3 answers

Update statement in Realm android

How should i update a already existing value using realm DB in android? I have been trying to update it but it is adding as a new value only not overwritting it
Dinu
  • 600
  • 3
  • 6
  • 27
20
votes
1 answer

App crashes during run-time after updating to Android Studio 3.6

I already tried Invalidating caches, cleaning the project, re-installing the app. I'm not using data binding. I'm using Realm plugin io.realm:realm-gradle-plugin:5.3.1 Here's some relevant info from build.gradle: compileSdkVersion…
vovahost
  • 34,185
  • 17
  • 113
  • 116
20
votes
6 answers

Kotlin Realm: Class must declare a public constructor with no arguments if it contains custom constructors

I'm creating a Realm object in Kotlin. Realm Object: open class PurposeModel(var _id: Long?, var purposeEn: String?, var purposeAr: String?) : RealmObject() When I compile the above code I'm getting…
Bhuvanesh BS
  • 13,474
  • 12
  • 40
  • 66
20
votes
3 answers

How can I avoid migration in RealmSwift

I am just testing some configurations with Realm and therefore I have added and deleted variables and lists from my realm classes. Since I am just testing I do not want to go through the migration process - I also don't have any data which is…
kangarooChris
  • 718
  • 1
  • 10
  • 21