I’m trying to embed two objects according to this explanation
class AccessibleDataTest: Object {
@Persisted(primaryKey: true) var _id: ObjectId = ObjectId.generate()
@Persisted var place = ""
@Persisted var accessibility: AccessTestItem?
@Persisted var accessAddress: AccessTestAddress?
}
//
class AccessTestItem: EmbeddedObject {
@Persisted var bell: String = ""
@Persisted var ramp: String = ""
}
class AccessTestAddress: EmbeddedObject {
@Persisted var postcode:String = ""
@Persisted var houseNumber: String = ""
}
So the key here is that I am using Flexible Device Sync.
After spending two days trawling the internet, reading the documentation about realm objects, changing the Embedded Object to a list of Embedded Objects, looking at the realm ios github examples, reading the documentation on subscriptions, by luck, I found the answer here in the fourth response:
Is it possible to define a subscription with a query on a field that belongs to embedded object?