Hi @otso I understand you can embed objects but where Im confused is when it comes to fetching linking objects.
As say you have the following schema
class Group: Object, ObjectKeyIdentifiable {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var owner_id: String
@Persisted var latest_content: List<Content>
@Persisted var members: List<String>
//Other values omitted for simplicity
}
class Content: Object, ObjectKeyIdentifiable {
@Persisted(primaryKey: true) var _id: ObjectId
@Persisted var created_at: Date = Date()
@Persisted var owner_id: String
@Persisted var image_id: String
@Persisted var group_id: Group?
}
A User can be a member of a group but there doesn’t seem to be an easy way of fetching the latest content for that group as there is not really a link between them (note that Content does have owner_id but group members should be able to view posts from other members as well not just there own). So how would I go about solving this ? Am I missing something ?