Join a table with left statement to the current query. * * await Flight.where( * Flight.field("departure"), * "Paris", * ).leftJoin( * Airport, * Airport.field("id"), * Flight.field("airportId"), * ).get()
(
this: T,
joinTable: ModelSchema,
originField: string,
targetField: string,
)
| 758 | * ).get() |
| 759 | */ |
| 760 | static leftJoin<T extends ModelSchema>( |
| 761 | this: T, |
| 762 | joinTable: ModelSchema, |
| 763 | originField: string, |
| 764 | targetField: string, |
| 765 | ) { |
| 766 | this._currentQuery.leftJoin( |
| 767 | joinTable.table, |
| 768 | joinTable.formatFieldToDatabase(originField) as string, |
| 769 | this.formatFieldToDatabase(targetField) as string, |
| 770 | ); |
| 771 | return this; |
| 772 | } |
| 773 | |
| 774 | /** Count the number of records of a model or filtered by a field name. |
| 775 | * |
no test coverage detected