• Reference • Query • SubCollection • Same ID We need to understand Client Side Join to understand the NoSQL relationship. There are several ways to create a relationship in Cloud Firestore.
xxx Key Relationship is used for cross-referencing. However, since Document only knows the ID of the reference destination, the developer must manage the path. /parent/xxx /child/yyy
the query does not contain data. • Value It contains data in the snapshot acquired by the query. There are two kinds of relationship by Query, SubCollection.
xxx ID: 2 parent: xxx ID: 3 parent: yyy /child/ Here, the relationship between parent and child is associated by ID. firestore .collection(“child”) .where(equalTo: “xxx”)
fields. It is necessary to separate documents between secure information and non-secure information. • When reading limits are applied, the query cannot be used. It is necessary to use SubCollection to create a secure collection. I will explain only the necessary points here. It takes time to explain security rules in detail.
parent: yyy child: xxx ID: xxx data: { } /parent/ /child/ Writes exactly the same data to the two references.Writes exactly the same data to the two references. By doing this, JOIN becomes unnecessary, and data can be accessed at high speed. /child/item/ ID: 0 parent: yyy child: xxx