usePluck()

The pluck method retrieves all of the values for a given key.


Usage

import { useRepo } from 'pinia-orm'import { usePluck } from 'pinia-orm/dist/helpers'import User from './models/User'const users = useRepo(User).all()// retrieve all values of the 'age' attributeusePluck(users, 'age')// retrieve all values of the 'role.title' attribute. The dot notation works only for 1n1 RelationsusePluck(users, 'role.title')

Type Declaration

export function usePluck(models: Collection, field: string): any[]