realm-mobile-platform

Anonymous user in Realm Mobile Platform

孤人 提交于 2019-12-04 10:44:11
Can I connect to a remote Realm without having to login? In Swift, the only way to create a synchronizable Realm is through the syncConfiguration property of a Realm.Configuration . Is there a method for getting an anonymous User so that anyone can connect to the remote Realm? marius Can I connect to a remote Realm without having to login? No, you always need to be authenticated. Is there a method for getting an anonymous User so that anyone can connect to the remote Realm? Yes, via SyncCredentials.anonymous() . This is now possible in Realm Cloud . Here's how I am doing it in Swift: if let

Realm Subquery to filter data from 1 table w.r.t table 2

守給你的承諾、 提交于 2019-12-01 13:56:55
Suppose that I have two models and corresponding tables in the Realm Database public class Customer :Object { dynamic var Id : String = "" dynamic var NAME : String = "" dynamic var Address : String = "" override public class func primaryKey() -> String? { return "Id" } } public class Bills :Object { dynamic var Id : String = "" dynamic var Amount : String = "" dynamic var CustomerId : String = "" override public class func primaryKey() -> String? { return "Id" } } What I am doing: I am getting list of All customers easily by doing this realmObj.objects(Customer.self) What I want: I want to do

Realm Subquery to filter data from 1 table w.r.t table 2

两盒软妹~` 提交于 2019-12-01 13:01:16
问题 Suppose that I have two models and corresponding tables in the Realm Database public class Customer :Object { dynamic var Id : String = "" dynamic var NAME : String = "" dynamic var Address : String = "" override public class func primaryKey() -> String? { return "Id" } } public class Bills :Object { dynamic var Id : String = "" dynamic var Amount : String = "" dynamic var CustomerId : String = "" override public class func primaryKey() -> String? { return "Id" } } What I am doing: I am

Realm - Can't create object with existing primary key value

两盒软妹~` 提交于 2019-11-30 17:45:21
I have a object Person with many dogs. App has separate page where it shows just dogs and other page where it shows person's dogs My model is as follows class Person: Object { dynamic var id = 0 let dogs= List<Dog>() override static func primaryKey() -> String? { return "id" } } class Dog: Object { dynamic var id = 0 dynamic var name = "" override static func primaryKey() -> String? { return "id" } } I have persons stored in Realm. Person has detail page where we fetch and show his dogs. If dog already exist, I update latest info for that dog and add it to person's dog list else create new dog

realm mobile platform, how to connect while offline?

折月煮酒 提交于 2019-11-30 15:40:59
the new realm mobile platform is advertised with offline support, however most tutorials does not show how that works in the examples... for example, in their todo app example this is the code used to connect to the server database SyncUser.logIn(with: .usernamePassword(username: username, password: password, register: false), server: URL(string: "http://127.0.0.1:9080")!) { user, error in guard let user = user else { fatalError(String(describing: error)) } DispatchQueue.main.async { // Open Realm let configuration = Realm.Configuration( syncConfiguration: SyncConfiguration(user: user,

Share realm between different users on Realm Object Server?

守給你的承諾、 提交于 2019-11-30 07:22:13
Is there currently a way to allow multiple users to access the same Realm? Right now the only way I could find is to use an 'app account' instead of an user account, as proposed in another question . thanks! In general, you can connect to a Realm file at a virtual path. They must be always absolute, so begin with a leading slash / and never carry a file suffix. Realms at a file name with two leading underscores are considered internal state of the Realm Object Server and have special meaning. If a path is prefixed by /~/ (like the home directory), the ~ will be expanded by the ID of the user,

Realm - Can't create object with existing primary key value

安稳与你 提交于 2019-11-30 01:26:30
问题 I have a object Person with many dogs. App has separate page where it shows just dogs and other page where it shows person's dogs My model is as follows class Person: Object { dynamic var id = 0 let dogs= List<Dog>() override static func primaryKey() -> String? { return "id" } } class Dog: Object { dynamic var id = 0 dynamic var name = "" override static func primaryKey() -> String? { return "id" } } I have persons stored in Realm. Person has detail page where we fetch and show his dogs. If

realm mobile platform, how to connect while offline?

北慕城南 提交于 2019-11-29 22:29:33
问题 the new realm mobile platform is advertised with offline support, however most tutorials does not show how that works in the examples... for example, in their todo app example this is the code used to connect to the server database SyncUser.logIn(with: .usernamePassword(username: username, password: password, register: false), server: URL(string: "http://127.0.0.1:9080")!) { user, error in guard let user = user else { fatalError(String(describing: error)) } DispatchQueue.main.async { // Open

Share realm between different users on Realm Object Server?

旧城冷巷雨未停 提交于 2019-11-29 09:31:17
问题 Is there currently a way to allow multiple users to access the same Realm? Right now the only way I could find is to use an 'app account' instead of an user account, as proposed in another question. thanks! 回答1: In general, you can connect to a Realm file at a virtual path. They must be always absolute, so begin with a leading slash / and never carry a file suffix. Realms at a file name with two leading underscores are considered internal state of the Realm Object Server and have special