I have my data model object here:
class Tiktoks: Object {
@objc dynamic var _id: ObjectId = ObjectId.generate()
@objc dynamic var _partition: String = ""
@objc dynamic var category: String = ""
@objc dynamic var date: Date = Date()
let tiktoks = RealmSwift.List<String>()
override static func primaryKey() -> String? {
return "_id"
}
convenience init(partition: String, category: String) {
self.init()
self._partition = partition;
self.category = category;
}
}
I have no problem modifying _partition
and category
, but since the tiktoks
list is defined by let
, it wouldn't work if I put it in the convenience init
function for me to be able to modify it. I tried putting @objc dynamic var
in front of it but it says Property cannot be marked @objc because its type cannot be represented in Objective-C
.
Is there any way to modify an array using the mongoDB iOS Swift SDK?