useMax()

Get the max value of the specified filed.


Usage

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

Type Declaration

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