Transactions and Relations¶
A relationship in the Backendless database must be declared as a column in a data table. That data table is referenced in this documentation as the parent table and similarly objects in the parent table are referred to as parent objects.
A relationship column in the parent table points to another table, which we refer to as the child table. Similarly the objects in that table are referenced as child objects or children. Consider a sample table schema below. The schema is for a table called
Person. The table has a relation column
visitedCountries, which represents a
1:N (one-to-many) relation with objects in the table
Object relationships make a variety of operations possible. For instance, the example above would enable the following:
Countryobjects to an object from the
- Adding additional
Countryobjects to an existing list of visited countries for a
- Removing some or all
Countryobjects from a
- Retrieving related
Countryobjects for a
All operations listed above can be executed in a Backendless transaction using the operations described further in this documentation. It is important though that the relation columns are declared before you run any transaction APIs.