useMax()

Usage

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

Type Declaration

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