Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IncludeThroughOptions

Through options for Include Options

Hierarchy

Index

Properties

as?: string

The alias for the join model, in case you want to give it a different name than the default one.

If an array: a list of the attributes that you want to select. Attributes can also be raw SQL (literal), fn, and col

To rename an attribute, you can pass an array, with two elements:

  • The first is the name of the attribute (or literal, fn, col),
  • and the second is the name to give to that attribute in the returned instance.

If include is used: selects all the attributes of the model, plus some additional ones. Useful for aggregations.

example
{ attributes: { include: [[literal('COUNT(id)'), 'total']] }

If exclude is used: selects all the attributes of the model, except the one specified in exclude. Useful for security purposes

example
{ attributes: { exclude: ['password'] } }
paranoid?: boolean

If true, only non-deleted records will be returned from the join table. If false, both deleted and non-deleted records will be returned. Only applies if through model is paranoid.

default

true

where?: WhereOptions<any>

The WHERE clause. Can be many things from a hash of attributes to raw SQL.

Generated using TypeDoc