UC3 - Join Data in a Same Index Storage

You can join data that is in the same index storage, using references to attributes. In the Data Model, you must have a property of Reference type.

Note: These references are similar to primary keys and foreign keys in SQL.

See Also
Defining and Managing Data Queries
UC4 - Join Data from Different Index Storages

For example, to retrieve all countries where the capital has more than 10 million residents:

  • The Country class must reference the City class.
  • In the Country class, the capital property is of type Reference. The type is Reference<country.City>, where country is the package name, and City the name of the class on which you want to join data.

In this use case, the data query expression in the SEARCH operator is:

Note: Using a SEARCH operator with an arrow (->) is not a real JOIN as it does not generate pairs in output.
Recommendation: Use the arrow -> or reverse <- operator in your expression to use references efficiently. For more information, see Expression Language.