Skip to main content
Module

x/denodb_esgi/mod.ts>Model.hasMany

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Latest
method Model.hasMany
import { Model } from "https://deno.land/x/denodb_esgi@1.0.15.1/mod.ts";

Find associated values for the given model for one-to-many and many-to-many relationships.

class Airport {
  static flights() {
    return this.hasMany(Flight);
  }
}

Airport.where("id", "1").flights();

Type Parameters

T extends ModelSchema

Parameters

this: T
model: ModelSchema

Returns

Promise<any[]>