Can someone explain how to organize the relationship between objects using Spring Boot and Firestore?
I am using spring-cloud-gcp-starter-data-firestore and I have two objects that must be located in different collections:
@Document(collectionName = "action_task")
public class ActionTask {
@DocumentId
private String id;
...........................
private EventRule eventRule;
}
@Document(collectionName = "event_rule")
public class EventRulePair {
@DocumentId
private String id;
...................
private String code;
private String eventType;
private Instant createdAt;
}
How organize relationships in the code and haw store in DB?