Hi,
I’m currently writing an app on iOS and i’m using Device Sync to sync my local realm to Atlas. Everything is working as expected. My device connects and can write and read to and from the synchronized realm.
I have an AccountObject which has an _id variable, a currentUser variable and lastly a list of another Realm object.
class AccountObject: Object, ObjectKeyIdentifiable {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var currentUserEmail: String
@Persisted var acctEntry = List<RealmAccountEntry>()
convenience init(currentUserEmail: String, acctEntry: List<RealmAccountEntry>) {
self.init()
self.currentUserEmail = currentUserEmail
self.acctEntry = acctEntry
}
}
and my RealmAccountEntry looks like this:
class RealmAccountEntry: Object, ObjectKeyIdentifiable {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var acctName: String
@Persisted var licensePlate: String
@Persisted var saleType: String
@Persisted var gallonsFilled: String
@Persisted var dollarAmount: String
@Persisted var miscellaneous: String
@Persisted var signatureString: String
@Persisted var dateAdded: String
@Persisted var timeAdded: String
convenience init(acctName: String, licensePlate: String, saleType: String, gallonsFilled: String, dollarAmount: String, miscellaneous: String, signatureString: String, dateAdded: String, timeAdded: String) {
self.init()
self.acctName = acctName
self.licensePlate = licensePlate
self.saleType = saleType
self.gallonsFilled = gallonsFilled
self.dollarAmount = dollarAmount
self.miscellaneous = miscellaneous
self.signatureString = signatureString
self.dateAdded = dateAdded
self.timeAdded = timeAdded
}
}
Now, everything reads/writes and contains exactly what it should, but in Atlas, when i review my collection, it shows an AccountObject with all the aforementioned fields and an Array (acctEntry) for the RealmAccountEntry list and then just shows an ObjectId for every index in that array (as it should), however it doesn’t let me expand a specific index of that array to see that indexes’ data.
For example, in Atlas, accountObject.accEntry is an array, it has 4 entries in that array, and it shows indices 0-3 with only an ObjectId, however, I can’t expand any of them to see what’s inside of it. When I run the code, I can read from the realm and each AccountObject does contain what it should, i’m just confused as to why I can’t expand a specific index of the acctEntry list in Atlas. Any ideas why that’s the case?