Skip to main content
Data JOINs execute on the backend in a single request. Use $data.fieldname to reference parent record fields.

joinOne (One-to-One)

Returns a single object or null. Use when you expect at most one related record.

joinMany (One-to-Many)

Returns an array of related records. Use when you expect multiple related records.

Multiple JOINs

Combine multiple joins in a single query:

Nested JOINs

Chain JOINs before calling .build() to create nested relationships:

Self-Referential JOINs

Join a collection to itself:

JoinBuilder Operators

Available operators on onField():

Complete Example: Social Feed

Performance Tips

JOINs execute on the backend in a single request, so they are efficient. However, consider these tips for optimal performance:
  1. Index foreign keys - Ensure fields used in JOIN conditions are indexed
  2. Select only needed fields - Use selectFields() instead of selectAll() when possible
  3. Limit nested data - For one-to-many JOINs, consider if you need all related records
  4. Use materialized views - For complex queries executed frequently, create a materialized view

Next Steps

Materialized Views

Pre-computed views for instant queries

CRUD Operations

Document operations with JOINs