Relationships

Many of the Collections in your app's database will need to be related to each other. For example, in a food ordering app, there might be a collection for Restaurants and a collection for Menus. You can create this relationship by opening one of the collections, clicking the Add Property button, and then choosing "Relationship" as the property type, and finally choosing the Collection you want to relate to.

 

Next, you will be prompted to select the type of relationship between these two collections

 

In the example above, you would choose the first option since a restaurant could have multiple menus like a Breakfast Menu and a Dinner Menu, but a menu can only ever belong to one restaurant.

You would choose the 2nd option if you were adding a relationship property to the Restaurant Types Collection relating it to a Restaurants Collection. A Restaurant can have only one Type, but a a Type can have multiple Restaurants.

 

Finally, you would choose the 3rd option if you were adding a relationship between your Users Collection and an Events Collection. An Event can have multiple Users and a User can have multiple Events.