realm

Realm Android Nested Query

情到浓时终转凉″ 提交于 2019-12-13 03:24:43
问题 Given the below classes and relationships, I need a RealmResults < Model1 > that satisfies the following requirements: Model1 int id RealmList<Model2> Model2 int id int model1Fk int type RealmList<Model3> Model3 int model2Fk I want to query all the Model1 entities that, for a specific Model2 related instance type, that Model2 instance has at least one Model3 related instance. In SQL that would be (Haven't tested it): select distinct model1.* from Model1 model1 join Model2 model2 on model2

Callback function not reloading database

坚强是说给别人听的谎言 提交于 2019-12-13 03:22:54
问题 I have an application where I get store and retrieve data from realm. I created a popUp that contains a textfield for input of the data and I also created a callback function that I use to reload the tableview after the save button is clicked but the problem now is the table does not get reloaded when the button is clicked. AddCategory.swift //Callback:- Property that holds a function var doneSaving: (() -> ())? @IBAction func saveActionBtn(_ sender: Any) { CategoryFunctions.instance

Execute transaction method using Realm continues to loop on each run android

☆樱花仙子☆ 提交于 2019-12-13 03:05:37
问题 In my app I am using Realm DB to store all the data in local database. I have some initial mock data which I want to show at the starting of the app. Previously I implemented begintransaction method. But after reading the documentation I have implented execute tranasction method. Beacuse this method is updating my new data easily. Now the problem is, whenever I click the option to show the recyclerview, the data is looping each time. for example I have 3 data. If I go back to previous page

Why does the Realm Set object work at random?

∥☆過路亽.° 提交于 2019-12-13 03:04:01
问题 The function to use a set of Realm objects is always random. Primary keys must not be changed and they must be unique. So I added another variable for compare. And I override isEqual(:) function. See below my code. class Model: Object { @objc dynamic var key = "" @objc dynamic var id = "" override static func primaryKey() -> String? { return "key" } override func isEqual(_ object: Any?) -> Bool { if let object = object as? Model { return id == object.id } else { return false } } } let model1

Realm object is missing all properties except primaryKey

落花浮王杯 提交于 2019-12-13 02:38:21
问题 I have a RealmObject model that my tableViewDataSource depends on. The cellForRowAtIndexPath1 method is able to access the properties fine, but the didSelectRowAtIndexPath gets all empty properties from the Realm object. I'm guessing this has to do with passing persisted Realm objects around but I'm not sure where to fix it. //viewController... override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) let realm = try! Realm() let books = realm.objects(Book) viewModel =

“Super expression must either be null or a function, not object” error

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 02:12:43
问题 I use example code from https://github.com/realm/realm-js/blob/master/examples/ReactExample/components/realm.js. 'use strict'; import Realm from 'realm'; class Todo extends Realm.Object {} Todo.schema = { name: 'Todo', properties: { done: {type: 'bool', default: false}, text: 'string', }, }; class TodoList extends Realm.Object {} TodoList.schema = { name: 'TodoList', properties: { name: 'string', items: {type: 'list', objectType: 'Todo'}, }, }; export default new Realm({schema: [Todo,

Issue in adding data in Realm in iOS

别来无恙 提交于 2019-12-13 01:09:18
问题 i'm new in using realm, i'm trying to save my api response in realm database. For that i read out there documents and started my work, I have created class of Objects in which a have my variables in which i want to save data now when i add data in realm app crashes with error, Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value . This is my class of Objects, class SingleChatRealm: Object { var actualNameFor_1_2_1_chat = "" var isGroup : Bool = true var isNewGroup

Exception when converting local realm to synced realm in Xamarin.iOS

别来无恙 提交于 2019-12-13 00:06:37
问题 Be assured I have seen all the answer for the very same questions . following this link enter switch-from-local-to-synced-realm I have a local realm from where I want to copy to synced realm . public void InitiateSyncForPost() { realm = Realm.GetInstance(ConfigForSync); //realm.WriteAsync((Realm obj) => //{ // var realmOld = Realm.GetInstance(Config); // var ding = realmOld.All<Post>().ToList(); // var dang = realmOld.All<Comment>().ToList(); // var ting = realmOld.All<ImageData>().ToList();

Does the realm.io database support multi column indexes or sorted indexes?

不想你离开。 提交于 2019-12-12 20:26:05
问题 Does the realm.io database support multi column indexes or sorted indexes? The documentation does not mention these features, but that seems odd since Realm is billed as a replacement for core data. 回答1: Yep! Realm lets you define multiple indexed properties in a single object class by overriding the indexedProperties class method and returning an array of the names of the properties you wish to index. Realm mentions this in the documentation here. You can sort objects by an index (Or any

Realm lazy queries - are they faster than OrmLite?

梦想与她 提交于 2019-12-12 19:34:35
问题 I have recently read inside documentation for Realm database that all of their queries are lazy and I am not sure, if I understand correctly the implications which this may cause. Let me explain how I understand it and please feel free to correct me if I'm wrong. The way I see it is that, whenever I am making such command mRealm.where(Customer.class).equalTo(Customer.ID, "someId").findFirst(); I do not get Java object with all filled data, that is contained in db for this customer. Instead