Skip to main content
Module

x/denodb/mod.ts>Model.avg

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

Compute the average value of a field's values from all the selected records.

await Flight.avg("flightDuration");

await Flight.where("destination", "San Francisco").avg("flightDuration");

Parameters

field: string