Includeable: ModelStatic | Association | IncludeOptions | {
    all: true;
    nested?: true;
} | string

Options for eager-loading associated models.

The association can be specified in different ways:

  • Using the name of the association: { include: 'associationName' } (recommended)
  • Using a reference to the association: { include: MyModel.associations['associationName'] }
  • Using the model to eager-load (an association must still be defined!): { include: Model1 }
    • if the association with that model has an alias, you need to specify it too: { include: { model: Model1, as: 'Alias' } }

You can also eagerly load all associations using { include: { all: true } } (not recommended outside of debugging)

Type declaration

  • all: true
  • Optional nested?: true