I am making the app with swift and MongoDB.
The app’s schema is this,
class User: Object, ObjectKeyIdentifiable {
@objc dynamic var _id: String = ""
@objc dynamic var _partition: String = ""
let mySchedules = RealmSwift.List<Schedule3>()
@objc dynamic var name: String = ""
override static func primaryKey() -> String? {
return "_id"
}
}
User is the app’s user which connects to MongoDB Realm App User.
class Schedule3: Object, ObjectKeyIdentifiable {
@objc dynamic var _id: String = UUID().uuidString
@objc dynamic var _partition: String = ""
@objc dynamic var title: String = ""
override static func primaryKey() -> String? {
return "_id"
}
}
In my app, each User has mySchedules = RealmSwift.List<Schedule3>()
, and all user can see schedules which other people make.
In this time, I do not know how partition strategies are good for my app. I tried configuring User partition as MongoDB Realm user ID and Schedule as “Public”(all schedules partition is Public). However, when I append a schedule to mySchedules
, I could not append because partition is not same.
Please help me the good way to solve this problem.
If you need more information, please tell me!