Module

x/denodb/lib/model.ts>Model.hasMany

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Latest
method Model.hasMany
import { Model } from "https://dotland.deno.dev/x/denodb@v1.4.0/lib/model.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<Model | Model[]>