useMin()

Usage

import { useRepo } from 'pinia-orm'
import { useMin } from 'pinia-orm/helpers'
import User from './models/User'
const users = useRepo(User).all()
// get the min of the 'age' attribute
useMin(users, 'age')
// get the min of the 'role.title' attribute. The dot notation works only for 1n1 Relations
useMin(users, 'role.title')

Type Declaration

export function useMin(models: Collection, field: string): number
Table of Contents